Turn off WordPress emojis

Support of emojis are standard ever since version 4.2 of WordPress. Which is nice. But when you don’t need this, it only puts extra time to the page load and still does nothing. WordPress doesn’t have an option to turn the emojis off. You can use a plugin to do this. But you can also use a few pieces of code!

The following code turns the emojis off. It doesn’t affect the overall operation of the website.

add_action( 'init', 'generate_disable_wp_emojicons' );
function generate_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' );

Copy the code and paste it into the functions.php of your (child)theme and the emojis functionality won’t get loaded anymore.

Pay attention: when you change themes, you will have to paste the code into the functions.php of your new theme. Otherwise the emojis will be re-activated.

Always backup your functions.php before changing it!

Ronald Heijnes
Ronald Heijnes

Since 2008 I keep myself busy with the functionality, management, maintenance and performance of self hosted WordPress. I like to share this knowledge. All in my spare time!

Articles: 44

Leave a Reply

Your email address will not be published. Required fields are marked *