Background of the issue:
I migrated my website from Server A to Server B. I am trying to load my page, but the layout is damaged. Inside the logs, I get an error related to the WPML plugin.
Symptoms:
PHP Fatal error: Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /var/www/html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/StringHtml/Repository/HtmlStringsRepository.php:31
Questions:
Why is my website layout damaged after migration?
How can I fix the PHP fatal error related to DOMDocument::loadHTML()?
Could you please provide more details on how you migrated your website?
Based on your description, here are some possible causes of the issue:
• Missing or corrupted data: The string data that WPML expects might be missing from the database or have become corrupted during migration.
• Encoding issues: Incorrect character encoding could prevent the DOMDocument class from interpreting the string as valid HTML.
Could you also check and share the collation settings of your database tables?
I recommend re-migrating your site using a migration plugin such as All-in-One WP Migration or Duplicator. These tools ensure an exact copy of your site (including the database and all fields) is properly transferred to the new server.
Does the same issue occur if you temporarily disable all plugins except WPML plugin?
If the issue persists, I’ll need to request temporary access (wp-admin and FTP) to your site—preferably to a staging or test site where the problem can be replicated.
When you log in to leave your next reply, you’ll find the required fields below the comment area. The information you enter is private, meaning only you and I can see and access it.
Please also include the exact steps to replicate the issue so I can investigate it more efficiently.