Home >CMS Tutorial >WordPress >How to deal with garbled code in WordPress background
Solution to the garbled characters in the WordPress background: 1. Find the “admin.header.php” file in the “wp-admin” folder of WordPress; 2. Set the “charset” attribute value to “UTF-8” "The format will return to normal.
#The operating environment of this tutorial: Windows 10 system, WordPress 6.1, Dell G3 computer.
What should I do if the WordPress backend is garbled?
WordPress backend management panel Chinese garbled troubleshooting and solution
When I accessed the backend, I suddenly found Chinese garbled characters in the backend. I checked the console with Firefox F12 and found that it was a coding error.
All content in the background can be found in the wp-admin folder of WordPress. Find the admin.header.php file here and you can see the following sentence:
You can see that the charset attribute of the page is the obtained blog_charset option setting, which is forcibly replaced with UTF-8 format.
After setting the encoding format to be forced to UTF-8, access the backend, everything is normal. At the same time, under the [Settings/Reading] panel, you can see an additional [Page and feed encoding] is set and empty.
After filling in UTF-8, this option disappears, and the modification of the admin.header.php file is restored, and the background is still normal.
[Page and feed encoding] settings are hidden by default and will only be displayed if their settings are not UTF-8. This can be seen by viewing the options.php and options-reading.php source code under wp-admin.
wp-admin/options.php
#wp-admin/options-reading.php
Recommended study: "WordPress Tutorial"
The above is the detailed content of How to deal with garbled code in WordPress background. For more information, please follow other related articles on the PHP Chinese website!