Home›Support›English Support›[Resolved] WPML fatal errors after Polylang migration and custom language setup
[Resolved] WPML fatal errors after Polylang migration and custom language setup
This thread is resolved. Here is a description of the problem and solution.
Problem: After migrating from Polylang to WPML and attempting to set up a complex language structure, you encountered critical errors. These included failures in duplicating pages and creating new pages in WordPress, with WPML crashing and showing errors related to database operations. Solution: We investigated the issue by disabling all plugins, including WPML, and switching to a default WordPress theme, followed by a database repair process. The persistence of the problem, even after these steps, suggests that the issue is not with WPML but likely with your site's database or server configuration. We recommend focusing on checking and possibly adjusting your database configuration and server setup to resolve these issues.
If this solution does not apply to your case, or if it seems outdated, 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 issues persist, please open a new support ticket at WPML support forum for further assistance.
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.
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.