search ]

Disable WordPress Emoji Scripts

WordPress loads emoji scripts (wp-emoji-release.min.js, etc.) on every page by default. Most sites do not need this, and the scripts add unnecessary HTTP requests and a bit of overhead.

To remove the emoji scripts, add the following code to your functions.php file:

/**
 * Remove WordPress emoji scripts
 */
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', function( $plugins ) {
	return is_array( $plugins ) ? array_diff( $plugins, array( 'wpemoji' ) ) : array();
} );

Result: fewer HTTP requests and lighter pages. For more performance tips, see the Guide to Google PageSpeed for WordPress Users.

Join the Discussion
0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!

Savvy WordPress Development official logo