Getting a blank screen and, in your error log, something like “element_id and type do not match for table ‘icl_translations’”? In plain English, WPML found a translation record in icl_translations that doesn’t match the real content it belongs to. It throws a fatal error to avoid further corruption. The good news: you can usually fix this by cleaning up a few bad rows and letting WPML rebuild them.
WPML is throwing “element_id and type do not match for table 'icl_translations'” and my site goes white. What does this mean, and how can I fix it safely?
If you’re wondering what’s broken: WPML is trying to set language data for a piece of content, but the matching row in icl_translations says it’s a different kind of thing.
The full error usually looks something like this (in your log or on screen):
PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match
for element_id: 33991 the database contains post_attachment while this function was
called with post_product in .../class-wpml-set-language.php
In plain English:
“For this element_id, icl_translations says it’s one type, but WPML was called with another.”
For example:
post_attachment but WPML is treating it as post_product.tax_nav_menu but WPML is treating it as tax_category.That usually happens because of:
icl_translations.WPML made this a hard failure on purpose so you notice the problem and fix the bad data instead of letting it grow.
Then pick the path that matches your situation.
If the admin loads (or loads after a refresh), use WPML’s built-in repair tools first. They fix most mismatches without touching the database directly.
Wait for it to finish. This goes through icl_translations and fixes rows where the element_type doesn’t match the actual post type/taxonomy.
If the fatal still happens after Step 1, try cleaning orphaned records.
Sometimes you’ll need to run these tools more than once, especially on older or heavily migrated sites. If the error goes away, you can stop here.
If the fatal error blocks your dashboard completely, you’ll need to touch the database directly just long enough to get back in.
Check your error log or the error output. You’re looking for a line like this:
element_id and type do not match for element_id: 777
the database contains post_attachment while this function was called with post_product
Make a note of the element_id number (in this example, 777).
Only do this with a backup in place.
wp_icl_translations table (or your custom prefix).element_id equals the ID from the error (for example, 777).Now load your site again.
Deleting a bad row won’t delete the actual post/page; it only removes the broken translation link so WPML can recreate it correctly.
If every refresh just shows a new element_id, you may have widespread corruption (for example, after a broken migration or failed install).
At that point, you have two realistic options:
For a full reset, you can follow the approach documented by WPML users in the official errata: reset language data from WPML → Support → Troubleshooting, deactivate, then reactivate and reconfigure WPML.
This error is common after importing from plugins like qTranslate X using an importer.
What happens is:
icl_translations.element_type (for example, treating an attachment as an event).If you see this only during or right after an import:
icl_translations as described above.If every re-run hits different IDs, stop and consider reaching out to WPML support with your import logs so they can check the mapping logic.
You’re in good shape when:
Hit Continue Chat and paste:
element_id and types mentioned).I’ll help you pick the safest next step.
Scroll down to the contact form below. Enter your name, email, and WordPress needs. Atiba will get back to you as soon as possible.
WP Assistant is a free tool created by Atiba Software, a WordPress design and development company located in Nashville, TN. If you need more personalized WordPress assistance let us know, and we’ll get back to you ASAP!