The reasons and solutions for the blank background of wordpress website, the 502 cannot be opened, and the opening is slow

4 minutes
seven hundred and eighty-five
zero

As the webmaster of the WordPress website, we may often encounter some strange problems: the WordPress background cannot open the display blank, and the WordPress background opens very slowly. We have to ask: Why can't WordPress open the background? Why does WordPress open very slowly in the background Yes, why? If it is slow on the website, it is understandable, but it is also wrong in the local environment on the local computer. I remember that the Gaoshi Silver Blog also mentioned some methods of WordPress background speed increase in the previous chapters, but they all explained from a certain method. In this chapter, Gaoshiyin Blog will give a comprehensive explanation“ Wordpress cannot open the background and is slow to open ”。

First, let's explain that the background of WordPress is blank, not because it can't be opened, but because WordPress programs have been connecting to foreign servers, such as checking the update of some plug-ins or themes, WordPress user avatars, and Google fonts. Therefore, if we want to solve the problem that WordPress cannot open the background and opens slowly, we should start from some aspects and put the code provided below into the functions.php file of your theme.

Step 1: Disable Google fonts. The codes are as follows:

//Remove Google Fonts
add_action( 'init', 'disableGoogleFont');
function disableGoogleFont(){
wp_deregister_style("open-sans");
wp_register_style("open-sans",false);
}

Step 2: cache gravatar avatar through the talker server. The codes are as follows:

//Accelerate Gravatar avatar through multi talk server
function mytheme_get_avatar($avatar) {
$avatar = str_replace(array("hongchengtech.cn","0.hongchengtech.cn","1.hongchengtech.cn","2.hongchengtech.cn"),"kuzhuti.duoshuo.com",$avatar);
return $avatar;
}
add_filter( 'get_avatar', 'mytheme_get_avatar', 10, 3 );

Of course, you can also use other domestic servers to cache gravatar avatars, such as the Qiniu server.

Step 3: Disable plug-in and theme check updates. The codes are as follows:

//Prevent plug-ins or themes from checking for updates,
add_filter("pre_http_request", disable_plugin_request,10,3);
function disable_plugin_request($a,$b,$c){
if(isset($b['body']['plugins']) || isset($b['body']['themes']))
return array('response'=>array('code'=>404));
return false;
}

If you do not want to disable the plug-in or theme update check, you should not use the plug-in or theme that the server has placed abroad, because it is very slow to open foreign servers in China, or even cannot open them, such as Google servers.

Through the above steps, the WordPress background will no longer be blank and cannot be opened, and the speed of WordPress background opening will be greatly improved. If through these steps, your WordPress background still cannot be opened, that is, your WordPress program or WordPress theme or your website space has a problem. You can try to upload the WordPress program or WordPress theme again, or change a better website space.

This article is written by: Chief Editor Published on Software Development of Little Turkey , please indicate the source for reprinting: //hongchengtech.cn/blog/43.html
Kuke_WP editor
author

Related recommendations

One year ago (2023-11-27)

12 WordPress enterprise theme templates are recommended! WordPress can be built without writing code!, Wordpress setup

When many companies choose WordPress to build their websites, they often don't know which theme is easy to use. There are too many WordPress corporate themes in the market for everyone to choose, but they always hesitate to make a decision. Here we have carefully sorted out 12 WordPress corporate themes, covering all walks of life
four hundred and fifty
zero
One year ago (2023-11-27)

Inventory of WordPress themes on online course website (updated in 2020), free WordPress themes

To build an online education platform using the WordPress website building program, it is not only necessary to choose a better virtual host provider, but also the most important thing is to use a core online course plug-in, and a powerful WordPress theme can also improve students' learning experience. Learn more about WordPre
four hundred and fifty
zero
One year ago (2023-11-27)

Best WordPress theme list in 2022 (free and paid), Wordpress resource network theme

When building a WordPress website, should you use a free theme or an advanced theme? What types of functions do you need, and how advanced do you want your website to be? These are all good questions. You need to explain before you spend money on WordPress topics. This is why we need to know all the details of the selected theme, and cover the topics from several
three hundred and ninety-five
zero

comment

0 people have participated in the review

Scan code to add WeChat

contact us

WeChat: Kuzhuti
Online consultation: