How to Disable Emojis in WordPress

Emojis, or the little smiley faces, thumbs up, and other expressive icons, are supported by WordPress by default. Emojis can be helpful and give your content personality, but they also have drawbacks. Emoji scripts and styles can make your pages heavier, which could cause your website to load more slowly. Turning off emojis is a wise choice for people who value performance and speed above all else, or who just don't need them.

If you need to disable emojis in WordPress, add the following code snippet at the bottom of your theme's functions.php file:

// Disable the emoji's
function themesdna_disable_wp_emojis() {
    // Remove the actions related to emojis
    remove_action('wp_head', 'print_emoji_detection_script', 7);
    remove_action('wp_print_styles', 'print_emoji_styles');
    remove_action('admin_print_scripts', 'print_emoji_detection_script');
    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');

    // Filter to remove TinyMCE emojis
    add_filter('tiny_mce_plugins', 'themesdna_disable_emojis_in_tinymce');
    add_filter('wp_resource_hints', 'themesdna_disable_emojis_remove_dns_prefetch', 10, 2);
}

// Remove TinyMCE emojis
function themesdna_disable_emojis_in_tinymce($plugins) {
    if (is_array($plugins)) {
        return array_diff($plugins, array('wpemoji'));
    } else {
        return array();
    }
}

// Remove emoji CDN hostname from DNS prefetching hints
function themesdna_disable_emojis_remove_dns_prefetch($urls, $relation_type) {
    if ('dns-prefetch' == $relation_type) {
        $emoji_svg_url = 'https://s.w.org/images/core/emoji/11/svg/';
        $urls = array_diff($urls, array($emoji_svg_url));
    }
    return $urls;
}

add_action('init', 'themesdna_disable_wp_emojis');

Our WordPress Themes

Below are some of our premium WordPress themes. View all our free and premium WordPress themes →
WriteMag PRO WordPress Theme

WriteMag PRO

WriteMag PRO is improved and feature-rich version of WriteMag Free WordPress Theme. When compare with the WriteMag free version, PRO...

$25.00
GridHot PRO WordPress Theme

GridHot PRO

If you have tried GridHot Free WordPress Theme, then you will love the premium version. GridHot PRO version has color...

$25.00
RapidWP PRO WordPress Theme

RapidWP PRO

Did you try RapidWP Free WordPress Theme?, Then you will love the premium version. RapidWP PRO is an improved, more...

$25.00
GridNext PRO WordPress Theme

GridNext PRO

If you have used GridNext Free WordPress Theme, then you will love the premium version. GridNext PRO version has color...

$25.00
FreshWP PRO WordPress Theme

FreshWP PRO

If you like FreshWP free WordPress Theme, you will love the premium version. FreshWP PRO is very user friendly, feature-rich,...

$25.00
TidyMag PRO WordPress Theme

TidyMag PRO

If you like TidyMag free WordPress Theme, you will love the premium version. TidyMag PRO is easy to use, feature-rich,...

$25.00
PowerWP PRO WordPress Theme

PowerWP PRO

If you like PowerWP free WordPress Theme, you will love the premium version. PowerWP PRO is an easy to use,...

$25.00
Simple Writer PRO WordPress Theme

Simple Writer PRO

Simple Writer PRO is a feature-rich, improved and advanced version of Simple Writer Free WordPress Theme. When compare with the...

$25.00

Can't you choose a single theme? Purchase All Themes for $75.

Save money with our low, one-time price for access to all of our 55 WordPress themes.