Reader
  • Home
  • About
  • Deals
  • Services
  • Contact

Disable Emojis in WordPress 4.2+ For a Faster Page Load

Last updated on August 9th, 2018 by Gabriel Livan

As of WordPress 4.2, a new feature was introduced that allows you to use the new emojis (the tiny smiley icons). While on some WordPress setups is useful, in many situations, especially when you are not using WordPress as a blog, you just don’t need them and the file /wp-includes/js/wp-emoji-release.min.js is loaded along with extra inline JavaScript code.

As I want my page to load as fast as possible and have the HTML code clean when analysing the source code (as a developer), I’d rather have all that extra code removed, especially since it loads on every page of my website. There are 2 ways in which you can do that. We’ll start with the most convenient one:

1) Disable Emojis plugin

disable emojis plugin
This is the quickest way to do that and emoji’s will still work in browsers which have built in support for them. This plugin simply removes the extra code bloat used to add support for emoji’s in older browsers.

2) Use the code below

I prefer to edit functions.php or to have a custom plugin with snippets as the block of code is pretty small. If you are comfortable with that, here’s the code that you can use:

function bit_disable_wp_emojicons() {
    // all actions related to emojis
    remove_action( 'admin_print_styles', 'print_emoji_styles' );
    remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
    remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
    remove_action( 'wp_print_styles', 'print_emoji_styles' );
    remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
    remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
    remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );

    // filter to remove TinyMCE emojis
    add_filter( 'tiny_mce_plugins', 'bit_disable_emojicons_tinymce' );
}

add_action( 'init', 'bit_disable_wp_emojicons' );

function bit_disable_emojicons_tinymce( $plugins ) {
    if ( is_array( $plugins ) ) {
        return array_diff( $plugins, array( 'wpemoji' ) );
    } else {
        return array();
    }
}
Note: If you prefer to have the old smilies from previous WordPress versions, while removing the new ones, you can use Classic Smilies plugin.

Filed Under: Plugins, Snippets, WordPress

About Me

Gabriel LivanHey, there! I'm Gabriel Livan, Web Developer, Blogger and Internet Marketer. I love making fast, secure and scalable web applications, running and travelling around the world. I blog about WordPress, site speed & security and quality tools for web professionals. Read more

What are you looking for?

Categories

  • AJAX (22)
  • Deals (10)
  • Design (30)
  • eBooks (2)
  • Flash (19)
  • Freebies (11)
  • General (62)
  • Giveaways (1)
  • Graphics (27)
  • HTML & CSS (35)
    • Frameworks (9)
  • JavaScript (160)
    • Frameworks (8)
    • jQuery (89)
    • MooTools (14)
  • Page Loading Speed (2)
  • Photoshop (3)
  • PHP (113)
  • Reviews (8)
  • SEO (6)
  • Statistics (2)
  • Web Tools (13)
  • WordPress (27)
    • Plugins (15)
    • Snippets (4)
    • Tools (2)
    • Tutorials (6)

Copyright © 2026 · BitRepository.com - All Rights Reserved

  • Home
  • About
  • Contact