Select Page

WordPress converts emoticons like “:)” into image-based emojis. The scripts required for this might slow down your website. Or maybe you just don’t want emojis on your website at all.

You can disable emojis completely in WordPress by disabling the Emoji scripts from being loaded in the <head> tag of your website.

Add this code to your theme’s functions.php file to disable Emojis completely:

function disable_emoji_scripts_completely() {
	// Remove the main script that displays emojis in your posts and pages.
	remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
	// Remove the emoji script stylesheet.
	remove_action( 'wp_print_styles', 'print_emoji_styles' );
	// Remove the emoji script for the admin section
	remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
	// Remove the emoji styles from admin section.
	remove_action( 'admin_print_styles', 'print_emoji_styles' );	
	// Remove from the feed.
	remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
	remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );	
	// Remove from the emails WordPress sends out.
	remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
add_action( 'init', 'disable_emoji_scripts_completely' );

The above code will completely disable the WordPress emoji scripts from your website. It will remove the associated scripts and styles from both the front-end and the admin section.