Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem:
The 'icl_string_packages' table doesn't seem to exist. This is the error that is appearing:

WordPress database error: [Table 'toplove_db.wp_icl_string_packages' doesn't exist]

Solution:
You can try adding this code to your functions.php and run any Frontend page once to get the missing tables installed.

function wpml_fix_missing_icl_tables() {
if( function_exists( 'icl_sitepress_activate' ) )
icl_sitepress_activate();
}

add_action( 'wp_footer', 'wpml_fix_missing_icl_tables' );

Or you can also run this query directly to your database to create the needed tables (need to update the code for each table):

SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
  
SET NAMES utf8mb4;
  
DROP TABLE IF EXISTS `wp_icl_string_packages`;
CREATE TABLE `wp_icl_string_packages` (
  `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `kind_slug` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `kind` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `edit_link` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `view_link` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `post_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

0% of people find this useful.

This topic contains 7 replies, has 7 voices.

Last updated by Matthias 2 years, 6 months ago.

Assigned support staff: Bernat Torras.

Author Posts
June 14, 2017 at 11:55 pm #1298682

lucianaC-2

Dear all
I have moved a website from the development environment to production using the "Duplicator" plugin and I am currently getting the following error on any page I try to save.

WordPress database error: [Table 'toplove_db.wp_icl_string_packages' doesn't exist]
SELECT COUNT(ID) FROM wp_icl_string_packages WHERE post_id = 2652

Looking at your knowledge base I have try to used to following fix on the functions.php, without success.

function wpml_fix_missing_icl_tables() {
if( function_exists( 'icl_sitepress_activate' ) )
icl_sitepress_activate();
}

add_action( 'wp_footer', 'wpml_fix_missing_icl_tables' );

The site currently in production is at the url hidden link

How should I proceed?

Thank you
L

June 15, 2017 at 5:47 am #1298732

Bernat Torras

Hi @lucianac-2,

Thanks for contacting support, I'll do my best to help you with this! 🙂

Yes, if a WPML table is missing, one good way to make sure all tables installed would be to run this code. Could you try to run it first on a staging version of your site (you can use Duplicator plugin to replicate it) or at least after having generated a backup of your database?

Let us know if the missing tables reappear after running the fix.

Thansk,
Bernat

June 15, 2017 at 11:35 am #1298987

lucianaC-2

Hello
Created the table "manually" according to another WPML support thread regarding this issue.

SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
 
SET NAMES utf8mb4;
 
DROP TABLE IF EXISTS `wp_icl_string_packages`;
CREATE TABLE `wp_icl_string_packages` (
  `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `kind_slug` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `kind` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL,
  `edit_link` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `view_link` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `post_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

At least for now it seams to be working ok.

Thank you

May 24, 2018 at 8:17 am #2220495

geoclimaS

Hi, I got the same issue.
Tried with function.php solution but didn't fix (debug.log still reporting missing table).
I have no idea how to add a table to db.
Any help?

July 10, 2019 at 1:03 pm #4180449

cboursinos

Same issue here. Why this is happening. Second site has this issue.

July 17, 2019 at 9:18 am #4228047

Iggy

Download "WPML Translation Management" from WPML. Activate and deactivate, if not needed. Table will be created 🙂

August 7, 2019 at 8:26 pm #4358119

bobK-2

Iggy's solution about installing "WPML Translation Management" plugin worked.

I don't know why it happened in my installation (e.g., if someone deleted something back then, but I doubt someone would have deleted a table), maybe we updated plugin and WPML has a new dependancy requirement.

I tried the functions fix, but it was not working.

I didn't want to update database directly (since it was suggested in 2017 and chance are the database structure changed since then).

So I was more at ease to install the latest version of a plugin and let it create the table correctly. I am sure it is done with the latest version of the structure. Less risk. better.

This should be added in the solutions in the header of this post. I would argue it should be the first solution suggested.

September 10, 2019 at 3:32 pm #4546911

Matthias

This solution also worked for me. #post-4228047