[Resolved] The site suddenly becomes unreadable...
This thread is resolved. Here is a description of the problem and solution.
Problem: The client experienced an issue where the site's text became unreadable with scrambled letters and charset changes after deleting previous administrators and transferring their settings. The issue was accompanied by PHP errors related to charset support in the console. Solution: We suggested checking if the problem persists when WPML is deactivated to determine if it's related to WPML or a broader database configuration issue. Additionally, we recommended changing the character encoding and collation of the database tables. Here are the steps we advised: 1. Temporarily deactivate WPML to see if the issue still occurs. 2. Follow the documentation to change the character encoding and collation of your database tables: https://wpml.org/faq/texts-showing-as/ If these steps do not resolve the issue or if the solution seems outdated or irrelevant to your current setup, 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 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.
Background of the issue:
I purchased the license recently to add it to this site, the site previously was using WPML, however not sure of the origin. It has 3 languages, MKD, ENG, ALB. The site is currently behind a Maintenance plugin, so I can provide credentials for you to check out the issue, or I can potentially provide the debug information.
Symptoms:
The site suddenly becomes unreadable with letter scrambling and changing of the charset.
Questions:
What could be causing the letter scrambling and charset changes on my site?
How can I resolve the issue of the site becoming unreadable?
The issue specifically happened when I was asked to delete previous users that were administrators, and no longer are. I did transfer their settings to another administrator on the site.
Thank you for reaching out to WPML support. While you're waiting for one of my colleagues to handle this ticket, let me offer you some initial debugging steps to assist with the issue promptly.
I think there is an issue with the character encoding of tables in your database. I suggest you follow the documentation below to change the character encoding and collation then check the issue again. https://wpml.org/faq/texts-showing-as/
Let us know the update. We will be happy to help if you need further assistance in this matter.
The charset set in wp-config is the following: define( 'DB_CHARSET', 'utf8mb4' ); which I think is the correct one.
I am using query monitor and the last error message that was prompted in the console was the following, after which the UTF issue and character scrambling happened.
Next I used the following queries which fixed the issue for now at least.
SELECT * FROM wp_options WHERE option_value LIKE '%UТF-8%';
UPDATE wp_options SET option_value = REPLACE(option_value, 'UТF-8', 'UTF-8') WHERE option_value LIKE '%UТF-8%';
SELECT * FROM wp_posts WHERE post_content LIKE '%UТF-8%';
UPDATE wp_posts SET post_content = REPLACE(post_content, 'UТF-8', 'UTF-8') WHERE post_content LIKE '%UТF-8%';
The site hasn't been maintained for a long time, the theme used for the site is not maintained since 2019. After running numerous scans malware has been detected, which I guess is potentially messing the charset in the DB...
I assume the issue/trigger causing this issue isn't WPML?
What are your results if you temporarily deactivate WPML? Does the issue persist?
This would give us a clear understanding if this is caused by WPML or possibly an issue in the database configuration, however, at the moment this does sound like it would not originate from WPML and more of a WPML related issue on the charset.