Website construction

Summary of various solutions behind Google's wall

Jager · August 26 · 2014 1345 times read

 Summary of various solutions behind Google's wall

1、 After Google is blocked, WordPress opens the tortoise speed solution

① Temporary settlement

After Google is blocked, when you open the page calling Open Fonts, you can get stuck! If you just found this problem and just planned to further deal with it, you found that the login background has been whiteboard, and you still have to wait?? In fact, you just need to press ESC to display the page. In fact, it is to stop loading Google Open Fonts that have gone out of the way. This method is also applicable to some websites that load CSS/JS slowly. You can bypass loading to view basic content, because sometimes we only need a download link.

② , It's all over

That is to say, the practice of disabling WordPress Google font can be divided into code method and plug-in method:

Code method : Paste the following code into the function template file functions.php ?> Front)

 /**Disable Google Online Style (valid for personal testing)**/ function remove_open_sans() { wp_deregister_style( 'open-sans' ); wp_register_style( 'open-sans', false ); wp_enqueue_style('open-sans',''); } add_action( 'init', 'remove_open_sans' );

Plug-in method : At present, WordPress has produced many plug-ins that disable Google or replace Google fonts, such as Disable Google Fonts Wait, you can choose one to try, and then you will know the effect. I won't say more.

The method to check whether it works is simple: open the background → plug-in source code → search fonts.googleapis.com If not, it will be successful!

③ Win win approach

Although disabling this font can achieve the fastest effect, there is a win-win solution: replace it with a usable font library, such as the 360 proxy font library, as follows:

Paste the following code into the functions.php file in the theme directory and save it (paste it to the last one without knowing the location ?> Just before)

 //Replace Google Fonts with 360 Open Font Library if (!defined('ABSPATH')) exit; class Replace_Google_Fonts { public function __construct() { add_filter('style_loader_tag', array($this, 'ohMyFont'), 888, 4); } public function ohMyFont($text) { return str_replace('//fonts.googleapis.com/', '//fonts.useso.com/', $text); } } new Replace_Google_Fonts;

This method comes from Su Yang's Blog The same author also packaged a WordPress plug-in, and used whatever he liked. Never use the BB plug-in or the code, and always believe that what he likes is the best!

It seems that there is almost no ink when I write here. Welcome to add it if you are knowledgeable and knowledgeable!

25 responses
  1. Reten 2014-8-26 · 13:07

    I want to Google something...

  2. Full Moon Blog 2014-8-26 · 13:26

    i see

  3. oldcheetah 2014-8-26 · 15:34

    It's good to ask the way

  4. east 2014-8-26 · 19:38

    I used the simplest method, not Google

  5. Healthy Weight Loss Blog 2014-8-26 · 21:59

    Very good, support it, I will often follow this blog in the future, and welcome to return!

  6. MOREOPEN 2014-8-27 · 0:43

    The gadget is very good. Google doesn't have to

  7. Life 2014-8-27 · 4:09

    Come here to learn experience, your station ranking is very powerful!

  8. Grey memory 2014-8-27 · 7:45

    Kill Google_Fonts long ago

    •  avatar
      Jager 2014-8-27 · 21:45

      It's a good way to get rid of everything at once.

  9. ijustplay 2014-8-27 · 8:58

    I didn't find it. The ESC key will solve the problem

    •  avatar
      Jager 2014-8-27 · 21:45

      Well, it is equivalent to stopping loading.

  10. October crystal 2014-8-27 · 9:14

    The wall is too high

  11. MOLOGO 2014-8-27 · 10:26

    GFW is awesome. It's powerful

    •  avatar
      Jager 2014-8-27 · 21:43

      China is mighty...

  12. Ball 2014-8-27 · 12:41

    Without Google, it is too inconvenient to search for things. Baidu comes out full of advertisements.

    •  avatar
      Jager 2014-8-27 · 21:43

      Well, that's true.

  13. Mengxuan Beauty 2014-8-27 · 16:55

    Yes, after learning, just like the code or plug-in, don't care too much.

    •  avatar
      Jager 2014-8-27 · 21:39

      Positive solution~

  14. PHP secondary development 2014-8-27 · 21:17

    I suddenly found that I haven't used Google for a long time.

    •  avatar
      Jager 2014-8-27 · 21:39

      Some tricky questions may still use Sister Gu.

  15. Phnomi 2014-8-28 · 0:25

    Can't do without Google

  16. Dacco Sanyo 2014-8-28 · 10:47

    I now use bing directly

  17. Anonymous 2015-4-6 · 19:03

    Pseudo big big day dynasty LAN ten thousand pieces, ten thousand pieces, ten thousand pieces!

  18. Understanding 2015-11-8 · 11:37

    IDC mistakenly blocks Baidu Spider, causing the website to be K