How to Disable Emojis in WordPress

As many of you know I am pretty OCD when it comes to speed. I work for a content delivery network (KeyCDN) and so when I’m not optimizing websites I am blogging about optimizing websites. With the release of WordPress 4.2 came updates for additional emoji support. That is all fine and dandy, but unfortunately what this means is that they are now including an additional javascript file wp-emoji-release.min.js?ver=4.3.1 in your header. If you aren’t using emojis, this creates an extra HTTP request, which in turn slows down your WordPress site.

wp emoji release min

Follow the instructions below on how to disable emojis in WordPress and get rid of that HTTP request. Every little optimization you make helps and it was one of many that resulted in my other blog loading in under 300ms.

Step 1

First you need to disable the conversion of emoticons to graphics. In your WordPress dashboard click into “Writing” under “Settings.”

wordpress settings writing

Step 2

Under the formatting settings uncheck the option to “Convert emoticons like :-) and :-P to graphics on display.”

writing settings formatting

Disable the Emoji Javascript File

Now we need to also disable that additional javascript file from creating the HTTP request. You have two options, either using a plugin or inserting some code into your functions.php file.

Option 1 – Disable Emojis Javascript File with WordPress Plugin

Ryan Hellyer created an awesome little free WordPress plugin called “Disable Emojis.”

Step 1

In your WordPress dashboard click into “Plugins” and “Add New.”

wordpress plugins add new

Step 2

Search for “Disable Emojis” and click on “Install Now.”

disable emojis wordpress plugin

Step 3

Click on “Activate Plugin.”

activate plugin wordpress

And that’s it! There are no settings you have to configure, your call to that Emoji’s javascript file should now be gone.

Option 2 – Disable Emojis Javascript File with Code

I’m not a fan of adding extra plugins because of the overhead, so I always prefer the code method. You can simply copy the code from Ryan’s plugin (props to him again for putting this together).

Step 1

In your WordPress dashboard click into “Appearance” and “Editor.”

wordpress appearance editor

Step 2

Click into your functions.php file. (Please backup this file first, because you can break access to your WordPress site if you don’t know what you are doing. I suggest copying the file locally with an FTP client like FileZilla)

wordpress functions file

Step 3

Paste the following code into the bottom of your functions.php file and click on “Update file.”

/**
 * Disable the emoji's
 */
function disable_emojis() {
	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_action( 'admin_print_styles', 'print_emoji_styles' );	
	remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
	remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );	
	remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
	add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
}
add_action( 'init', 'disable_emojis' );

/**
 * Filter function used to remove the tinymce emoji plugin.
 * 
 * @param    array  $plugins  
 * @return   array             Difference betwen the two arrays
 */
function disable_emojis_tinymce( $plugins ) {
	if ( is_array( $plugins ) ) {
		return array_diff( $plugins, array( 'wpemoji' ) );
	} else {
		return array();
	}
}

And that’s it! You’re all done. No more annoying delay or HTTP request just for emojis. If this tutorial on how to disable emojis in WordPress was helpful please let me know below in the comments and sharing is always appreciated.

GET MORE STUFF LIKE THIS

Marketing, WordPress, Blogging Tips, SEO and Reviews, once a week.

RankXL SEO Niche Course is back open for limited time!Learn More
82 Shares
Tweet
Share
Share
Buffer