As far as I know, WordPress uses the getText library to implement multi-language support, but this library runs quite inefficiently and is a significant performance bottleneck for WordPress. Since we can localize themes directly by editing theme files, and most Chinese WordPress blogs already use Chinese-localized themes, loading language packs on the WordPress frontend isn’t strictly necessary. By disabling WordPress’s frontend language pack loading, we can achieve a noticeable speed improvement.
The method is simple: modify the wp-config.php file to prevent WordPress from loading language packs on the frontend.
Open the wp-config.php file and replace require_once(ABSPATH . 'wp-settings.php'); with the following code:
if(WP_ADMIN === true) {
define ('WPLANG', 'zh_CN');
} else {
define ('WPLANG', 'xxxxxxxxx');
}
require_once(ABSPATH . 'wp-settings.php');
The principle behind this method is to alter the WPLANG constant so that WordPress cannot correctly load language packs, thereby improving runtime performance. Based on testing, removing language pack loading can improve WordPress execution speed by approximately 0.3 to 0.5 seconds.