Home > CMS Tutorial > WordPress > How to deal with garbled code in WordPress background

How to deal with garbled code in WordPress background

藏色散人
Release: 2023-02-03 13:48:29
Original
2726 people have browsed it

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.

How to deal with garbled code in WordPress background

#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.

How to deal with garbled code in WordPress background

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:

How to deal with garbled code in WordPress background

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.

How to deal with garbled code in WordPress background

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.

How to deal with garbled code in WordPress background

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

How to deal with garbled code in WordPress background

#wp-admin/options-reading.php

How to deal with garbled code in WordPress background

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template