Reasons for WordPress speed problems caused by Google Fonts
WordPress has been added to Google Fonts since version 3.8 + (don't ask me what Google Fonts is), and then click it, because of the recent sensitive cycle (No. 35), Tianchao is pushing, A series of Google websites are thoroughly walled, including Google apis.com where Google Fonts is located. Therefore, if you open your WordPress site in the login status, it will be very slow, because the root cannot load the font file. If you are not logged on and your topic is not a foreigner's topic, it is generally normal.
Solution
The problem should be solved. In Tianchao, since you have to endure it, you can change your mind. The solution below is to prohibit the loading of the Google Fonts, and to replace the loading source. It is described as follows:
Method 1: [plug-in] disables the WordPress background from loading Google Fonts
Install and enable Disable Google Fonts or Remove Open Sans font Link from WP core. Nothing to say.
Method 2: [code] add code directly to the functions. php file
There are a lot of code on the network. For details, refer to the following:
The code is as follows: |
Copy code |
Add_filter ('gettext _ with_context ', 'Disable _ open_sans', 888, 4); function disable_open_sans ($ translations, $ text, $ context, $ domain) {if ('open Sans font: on or off' ==$ context & 'on' ==$ text) {$ translations = 'off';} return $ translations ;} function dw_remove_open_sans () {wp_deregister_style ('Open-sans '); wp_register_style ('Open-sans', false); wp_enqueue_style ('Open-sans ','');} add_action ('init ', 'dw _ remove_open_sans ');
|
Method 3: [code] replace the loading source of the open sans font
Open the wp-nodes des/script-loader.php file in wordpress code and search: fonts.googleapis.com to find this line of code:
The code is as follows: |
Copy code |
$ Open_sans_font_url = "// fonts.googleapis.com/css? Family1 = Open + Sans: 300 italic, 400 italic, 600 italic, 300,400,600 & subset = $ subsets "; |
Replace fonts.googleapis.com with fonts.useso.com.