This thread is resolved. Here is a description of the problem and solution.
Problem:
The client reported issues with 'ghost' product categories in their database, where certain term IDs appeared in the term_taxonomy table but not in the terms table, causing discrepancies and errors.
Solution:
We identified that the problem was due to corrupted terms in the database, which is not directly related to WPML but to the WordPress database itself. To address this, we recommended:
1. Deleting records from the term_taxonomy table that do not exist in the terms table using the following SQL query:
DELETE FROM `eb21term_taxonomy` WHERE term_id NOT IN (SELECT term_id FROM eb21terms);
2. Deleting records from the term_relationships table that do not exist in the term_taxonomy table using this SQL query:
DELETE FROM `eb21term_relationships` WHERE term_taxonomy_id NOT IN (SELECT term_taxonomy_id FROM eb21term_taxonomy);
We advised the client to ensure a complete backup of their database before proceeding with these queries to prevent any potential data loss and suggested consulting a WordPress professional if they are not comfortable performing these operations themselves.
Please note that this solution might be outdated or not applicable to your specific case. If these steps do not resolve your issue, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.
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 is split from https://wpml.org/forums/topic/duplicate-queries-5/
Tagged: WCML
Related documentation:
This topic contains 11 replies, has 2 voices.
Last updated by Bobby 5 months, 2 weeks ago.
Assisted by: Bobby.
Author | Posts |
---|---|
May 28, 2024 at 9:43 pm #15681129 | |
tannerT |
1.) I have adjusted some of the required assets to: "Translatable 2.) None of my options within "Taxonomies Translation" are set to "use translation if available or fallback to default language"? 3.) The counter being off is a problem, and applicable to WPML. Please feel free to create a new ticket, as I would like it resolved (hence me incorporating it in the ticket) |
May 28, 2024 at 9:44 pm #15681131 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Hi there, I am reviewing the issue with the counter and will update you here shortly. |
May 28, 2024 at 11:01 pm #15681226 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Hi, I was able to locate the 'ghost' product categories, we are reviewing this and will update you as soon as there are news. |
May 29, 2024 at 1:51 pm #15684317 | |
tannerT |
Great, feel free to purge them. All products are in the English category group above (before the ghost categories begin) |
May 30, 2024 at 6:22 pm #15689715 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
We are still working with our team on this, and will update you as soon as we have some feedback. |
May 31, 2024 at 2:51 pm #15693010 | |
tannerT |
We are still waiting for a resolution from your team on this, and will wait an update as soon as you have some feedback |
May 31, 2024 at 8:26 pm #15694086 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Hi there, We have found a few category IDs 10129,10132,10135 that do not exist when we try to edit them. To fix this we will need to continue our work in the database, as you can imagine this cannot be done on your live site. If possible, we need to make a copy onto our Cloudways staging servers, however, the requests during the copy migration are being blocked. "Our requests are getting blocked for your source site hidden link." Please temporarily whitelist this action and update me when ready or provide us with a staging site where we can directly work on the database. |
June 3, 2024 at 2:16 pm #15698159 | |
tannerT |
You can do this on the live server, just download that table prior to your actions for restoration if anything goes astray. We have over 100GB of content on the site; staging for such a minor issue seems excessive. If you insist, then please define "whitelist this action" and the steps you would like us to take to whitelist this action You can also let us know the steps you would like us to take in the DB as well. I definitely recommend including as much viable content in each of your replies to actually ensure there is progress by the time we reply if you do want a positive review from us Thank you, [nothing was resolved in this message] |
June 4, 2024 at 6:17 pm #15704089 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Unforutnately the error we are getting is quite vague, otherwise, I would have provided more information, I was hoping you would be aware of any firewalls in place that would prevent the migration from happening. Based on the information you shared in your previous thread let's proceed this way for now to expedite this. Please provide us with PHPmyAdmin access, I have enabled the private field reply. Also, please verify that you have a recent and working backup before proceeding. We will not delete anything before confirmation, for now, we will inspect, however, For any accidental action a backup made by your team is crucial. |
June 5, 2024 at 5:47 pm #15708433 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
We have reviewed the database and can confirm that the terms tables are corrupted. For example, term ID 10129 is showing because it exists in the _term_taxonomy table (see screenshot), but we can't edit or delete it because it doesn't exist in the _terms table (see screenshot). There are many terms like this. This issue is not related to WPML and should be addressed by WordPress support. If you are not comfortable working with the database and making the necessary fixes, we highly recommend reaching out to a WordPress professional to patch it. We can suggest some queries to clear the corrupted terms, but these queries are not tested, so you would be using them at your own risk. Additionally, we will not be responsible for any data loss. It is crucial to have a complete backup before proceeding. 1. First, delete the records from term_taxonomy table those does not exist in terms table. DELETE FROM `eb21term_taxonomy` WHERE term_id NOT IN (SELECT term_id FROM eb21terms); 2. Now delete records from term_relationships table those does not exist in term_taxonomy table. DELETE FROM `eb21term_relationships` WHERE term_taxonomy_id NOT IN (SELECT term_taxonomy_id FROM eb21term_taxonomy); |
June 6, 2024 at 2:36 pm #15712078 | |
tannerT |
You are more than welcome to download table -> run query -> verify on your end. I have just done this process: QUERY 1: SQL query: QUERY 2: SQL query: Can you confirm issue is resolved? Looks like it is on my end |
June 10, 2024 at 5:38 pm #15723427 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
I'm glad to hear that the queries worked ok to resolve this issue! The Cpanel details are not working anymore, however, after discussing this with my colleague, if the queries were executed successfully without any error the records should be deleted from DB. |
June 10, 2024 at 7:13 pm #15723702 | |
tannerT |
Confirmed, thank you |