Hello,
we are working on a development copy of a live website.
We migrated from Polylang to WPML using the official “Migrate Polylang to WPML” plugin. The migration initially seemed successful. Existing German and English translations looked correct.
After that, we wanted to prepare this target language structure:
- de-de = Germany German
- de-en = Germany English
- en-en = International English
- us-en = USA English
The existing content should be reused like this:
- current German content → de-de
- current English content → de-en
- then based on English also create en-en and us-en
While preparing this setup, we ran into serious WPML errors.
Main problem 1:
Duplicating even a single normal page in WPML Translation Dashboard fails.
Main fatal error from debug log:
Argument #2 ($post) must be of type WP_Post, null given
The stack trace shows that WPML crashes in:
sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Infrastructure/WordPress/CompositionRoot/Config/Event/Translation/Links/ItemUpdateEvent.php line 55
and before that wp_insert_post() returns an invalid result, ending up with 0 / NULL.
Main problem 2:
This is no longer limited to duplication. Even clicking “Add new page” in WordPress causes a critical error with the same WPML stack trace.
So currently WPML also breaks normal page creation.
Main problem 3:
We restored a backup from earlier the same day, before creating the new custom languages, when only German and English existed. The problem still remained.
Additional context:
this is a dev site cloned from live
the site previously used Polylang
Elementor and Elementor Pro are used
during debugging we also found broken Action Scheduler issues on dev and repaired the wp_actionscheduler_actions table once
we also found orphaned rows in wp_icl_translations with element_id = NULL and removed them, but the fatal error still remains
What we need:
We need help restoring WPML to a stable state so that...
-normal page creation works again
-page duplication works again
-existing translated content can be safely reused
-we can implement the target language structure without rebuilding all translations manually
Do we need to set up WPML again from scratch and recreate all translations manually, or is this still fixable? Has the setup become too corrupted to recover safely?
Please share the access credentials to the site in your next message, which I have set private. This will allow me to reproduce the issue and double-check the WPML configuration.
Confirm you have created a full site backup that you can restore if necessary.
I can see that the issue persists even after disabling all plugins (including WPML), switching to a default WordPress theme, and running the database repair process.
These results indicate that the problem is not caused by WPML. Instead, it points to an issue within the site’s database or server environment, which is affecting WordPress’s ability to create new content correctly.
At this stage, I recommend focusing on the database configuration and server setup, as the root cause is likely located there.