Want to Get Rid of the Open Sans Font in WordPress?

Did you know that China doesn’t like Google? Did you know that WordPress, for all its awesome features, defaults to the Open Sans font and fetches it via CDN from Google’s servers? Well, now you do. If you’re wondering why this is a concern (but, let’s face it, if you’re here, it’s probably a concern), the issue is this font causes HUGE latency with Chinese clients. Yea, it sucks. Anyway, here’s the fix to completely remove the Open Sans font in your 3.9 WordPress site:

function remove_open_sans() {
  // Remove Open Sans font; causes issues with China
  wp_deregister_style('open-sans');
  wp_register_style('open-sans', false);
  wp_enqueue_style('open-sans');
}
add_action( 'login_init', 'remove_open_sans' );            // Remove from the login page.
add_action( 'wp_enqueue_scripts', 'remove_open_sans' );    // Remove from the main site.
add_action( 'admin_enqueue_scripts', 'remove_open_sans' ); // Remove from the admin site.

Note that this is the preferred method to remove the Open Sans font, unless you want to edit core files, which could subsequently (obviously) cause issues with the rest of your site and if you upgrade your WordPress instance. This was gathered from several sites, so hopefully this will save you some time. Enjoy!