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

Problem: I am trying to update the data under "Countries >> Continents" in WP. I expected to see population (millions) field is supposed to have this number: 922. Instead, I still see the old number: 988

Solution: Make sure that the translated taxonomy slug is different than the original taxonomy slug. The changes made in the custom fields (like the ones from Yoast SEO, for example) cannot be saved when the slug is the same in original and translated taxonomy. You can temporarily change the slug, make the changes, and put back the same slug.

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 topic contains 2 replies, has 2 voices.

Last updated by Nate Freedman 9 months, 3 weeks ago.

Assigned support staff: Radu.

Author Posts
August 12, 2019 at 10:52 am

Nate Freedman

I am trying to: update the data under "Countries >> Continents" in WP.

Link to a page where the issue can be seen: hidden link

I expected to see: population (millions) field is supposed to have this number: 922

Instead, I got: Still see the old number: 988

We looked into this, and one of the developers who helped us out suggested the following:

"The problem can be found on line 42 of class-wpml-term-clauses.php in WPML_Term_Clauses->filter() found in the directory

/wp-content/plugins/sitepress-multilingual-cms/classes/query-filtering/. This is what is on that line:

|| $this->debug_backtrace->is_function_in_call_stack( 'get_term_by' )

Basically WordPress is looking at the term you are attempting to save in the Continent taxonomy and if it finds another with the same slug is stops processing because it thinks it is a duplicate. The WPML_Term_Clauses->filter() is evidently suppose to change the SQL query so that WordPress will find the term you are currently editing and not the first one found in the database but because of that line above it does not.

When I comment that line out the other language records in Continent save as expected.

What to do?
Here is what I'd recommend, in reverse order:

1. Hack the plugin by commenting out that line and hope it does not break anything else in the site.

2. Disable the 'terms_clauses' hook and replace it with a custom plugin that fixes this issue and hope that when you or the client upgrades WPML in the future it does not conflict. This would require spending some time coming up with a more robust way to implement the equivalent of WPML_Term_Clauses->filter()."

Could you help us disable the line mentioned in this, and see if it causes any abnormlalities in the site's functionality? Please note that we're trying to update all the fields under Continents, I only mentioned the Populations field as an example.

August 13, 2019 at 8:47 am #4385971


Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Nate,

Thank you for reaching out the WPML support!

Can you try to change the slug of the translated continent to be different than the original one and then change the value of the Population (millions)
field, please? After this, just put back the same slug for the continent and tell me how things work.


August 15, 2019 at 7:09 am #4399255

Nate Freedman

My issue is resolved now. Thank you!