Skip to content

Remove Emoji Support in WordPress 4.2+

Did anyone actually ask around before making this “feature” mandatory? Let’s get rid of this crap…

Option 1

Install Ryan Hellyer’s “Disable Emojis” plugin.

Option 2

Custom code. Place following into functions.php

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php

/**
 * Remove emoji support.
 */
function grd_remove_emoji() {
	remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
	remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
	remove_action( 'admin_print_styles', 'print_emoji_styles' );
	remove_action( 'wp_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' );

	// Remove from TinyMCE
	add_filter( 'tiny_mce_plugins', 'grd_remove_tinymce_emoji' );
}
add_action( 'init', 'grd_remove_emoji' );

/**
 * Filter out the tinymce emoji plugin.
 */
function grd_remove_tinymce_emoji( $plugins ) {

	if ( ! is_array( $plugins ) ) {
		return array();
	}

	return array_diff( $plugins, array( 'wpemoji' ) );
}

About Greg Rickaby

Director of Engineering @WebDevStudios / Author & Tech Editor @ForDummies / @WordPress Contributor / @gatsbyjs Maintainer / Follow Greg on Twitter

6 Comments

  1. Holly Freeman Styling on July 11, 2015 at 01:33

    Thanks!

  2. Aan on August 11, 2015 at 05:16

    Yeah, the source code is pretty horrible. I was a little surprised when I saw it appear in my source. Thankfully it wasn’t too hard to get rid of.

  3. Joe on July 14, 2016 at 19:56

    Thanks for posting… emoji arrows were wrecking havoc on some html arrows in my slideshow carousel.

    Replacing html with images is insane.

    But what’s worse is not having an on off toggle in settings.

  4. Rob on July 29, 2016 at 03:41

    Just imagine what environmentalists would say if they found out how much electricity was being wasted by server CPU’s processing WordPress emoticons that weren’t really needed to begin with.

    • Joseph Dickson on August 6, 2016 at 12:21

      You just made my day.

  5. Karim on October 19, 2017 at 12:25

    Hi guys there is new version available: https://wordpress.org/plugins/disable-emojis-littlebizzy/

    have updated functions too for dequeue extra style. cheers

Leave a Comment