Remove the emoji script and styles
Stops WordPress from loading its emoji script and styles on every page. Every current browser shows emoji on its own.
<?php
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_action( 'wp_enqueue_scripts', 'wp_enqueue_emoji_styles' );
remove_action( 'admin_enqueue_scripts', 'wp_enqueue_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' );
// No DNS prefetch for the emoji images either.
add_filter( 'emoji_svg_url', '__return_false' );
In these packs
- Clean up the head: Remove the links, scripts and styles WordPress adds to every page that most sites never use.
- Performance: Small changes that save the server and the browser some work.