WordPress loads an emoji script (wp-emoji-release.min.js) on every page to provide backwards-compatible emoji support for older browsers. Since all modern browsers natively support emojis, this script is unnecessary for most sites and adds extra HTTP requests and processing time.
What Gets Removed
- The inline JavaScript that detects emoji support
- The external
wp-emoji-release.min.jsscript file - The emoji-related CSS styles
- The DNS prefetch for the emoji CDN
Method: Add to functions.php
/**
* Disable WordPress emoji scripts and styles
*/
function disable_emojis() {
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');
// Remove DNS prefetch for emoji CDN
add_filter('wp_resource_hints', function($urls, $relation_type) {
if ('dns-prefetch' === $relation_type) {
$urls = array_filter($urls, function($url) {
return strpos($url, 'https://s.w.org/images/core/emoji/') === false;
});
}
return $urls;
}, 10, 2);
}
add_action('init', 'disable_emojis');
Performance Impact
Removing the emoji script saves approximately 15-20 KB of JavaScript and eliminates one HTTP request per page load. While this may seem small, it adds up across all your pages and improves your Core Web Vitals scores.
Verify with InspectWP
Run a new InspectWP scan after adding this code. The WordPress section should no longer detect the emoji script on your site.