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.

Our next available supporter will start replying to tickets in about 2.85 hours from now. Thank you for your understanding.


This topic contains 1 reply, has 2 voices.

Last updated by Shekhar Bhandari 12 months ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
June 6, 2019 at 3:54 pm #3970707


I am connecting to another WordPress instance (using same database but different table prefix) from my main WordPress site. My main wordpress site has WPML plugin activated but second site has not. I am using following code:

global $wpdb;
$wpdb_backup = $wpdb;
$wpdb = new wpdb('xxx','yyy','zzz','localhost');

$args = array(
'post_type' => 'post',
'posts_per_page' => 3,
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',

$query = new WP_Query($args);

if($query->have_posts()) {
while($query->have_posts()) {

// do stuff here

$wpdb = $wpdb_backup;

The problem is that new connection is not looking directly to blog_posts table but is trying to find post through WPML table causing this problem:

WordPress database error: [Table 'd54525_720.blog_icl_translations' doesn't exist]

Is there any way to disable WPML and enable it after query or change WP query to ignore WPML functions? Thanks for help.

June 7, 2019 at 3:34 am #3973775

Shekhar Bhandari

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Welcome to WPML support. I'd be assisting you further on this issue.

It seems you are trying to run the code in the secondary languages and the default language of the posts from another site is not matching, creating the issue, you can switch language and retrieve the posts in the correct language to see if it helps.

Anyway, custom programming help is beyond the scope of our support.

At this point, I would suggest you consider contacting one of our certified partners from this link:

Before doing so please have a look also here:

You will get the custom assistance you need to get on with your project.