Remove Emoji code from WordPress and make your website faster

The following piece of code in your WordPress website’s code appears phishy? Well, it’s not. WordPress loads a bit of code to properly process and display those funny emojis ( similar to smileys or emoticons). However, this does involve additional HTTP requests and adds some extra load in terms of speed and rendering of your website.

Here’s the pieces of Emoji code WordPress adds in your website’s head:

<script type="text/javascript">
	window._wpemojiSettings = {"baseUrl":"https:\/\/\/images\/core\/emoji\/12.0.0-1\/72x72\/","ext":".png","svgUrl":"https:\/\/\/images\/core\/emoji\/12.0.0-1\/svg\/","svgExt":".svg","source":{"concatemoji":"http:\/\/\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.4.2"}};
	/*! This file is auto-generated */
	!function(e,a,t){var r,n,o,i,p=a.createElement("canvas"),s=p.getContext&&p.getContext("2d");function c(e,t){var a=String.fromCharCode;s.clearRect(0,0,p.width,p.height),s.fillText(a.apply(this,e),0,0);var r=p.toDataURL();return s.clearRect(0,0,p.width,p.height),s.fillText(a.apply(this,t),0,0),r===p.toDataURL()}function l(e){if(!s||!s.fillText)return!1;switch(s.textBaseline="top",s.font="600 32px Arial",e){case"flag":return!c([127987,65039,8205,9895,65039],[127987,65039,8203,9895,65039])&&(!c([55356,56826,55356,56819],[55356,56826,8203,55356,56819])&&!c([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]));case"emoji":return!c([55357,56424,55356,57342,8205,55358,56605,8205,55357,56424,55356,57340],[55357,56424,55356,57342,8203,55358,56605,8203,55357,56424,55356,57340])}return!1}function d(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(i=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},o=0;o<i.length;o++)t.supports[i[o]]=l(i[o]),t.supports.everything=t.supports.everything&&t.supports[i[o]],"flag"!==i[o]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[i[o]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(r=t.source||{}).concatemoji?d(r.concatemoji):r.wpemoji&&r.twemoji&&(d(r.twemoji),d(r.wpemoji)))}(window,document,window._wpemojiSettings);
<style type="text/css">
img.emoji {
	display: inline !important;
	border: none !important;
	box-shadow: none !important;
	height: 1em !important;
	width: 1em !important;
	margin: 0 .07em !important;
	vertical-align: -0.1em !important;
	background: none !important;
	padding: 0 !important;

If your site is not something where a lot of emojis will be needed, it should be fine to get rid of the extra “junk” and make your site faster and more SEO-friendly. In addition, this block of code had been the spot for malware infections in the past.

Quick, one-step process to remove the emoji code from WordPress

You will need to edit the functions.php file in your specific theme folder. Go to your WordPress installation location, find wp-content > themes, and then go inside the directory of the theme in use. You should find the functions.php file in there.

Here’s the code snippet you need to place in your theme’s functions.php file. Paste the code in a new line after the beginning <?php

remove_action('wp_head', 'print_emoji_detection_script', 7); // Remove Emoji code
remove_action('wp_print_styles', 'print_emoji_styles'); // Remove Emoji CSS and related stuff
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );

That’s it. The emoji code should be gone! Make sure you clear the cache if you’re using a caching plugin.

There are a bunch of other code snippets you might want to clean up in default WordPress header. Follow the instructions on how to remove more junk from WordPress header, and you should now have a cleaner leaner page code.

Were you looking for an emoji remover from Face or Photo? or even from Video?

This is a warning for those who come here looking for ways to remove emojis from images. (Because I noticed many such requests here.)
Software or online tools claiming to remove emojis from photos on the internet and unhide the face or background image are saying half-truths. The emojis or smileys on a photo have already removed that area of the original image. The content is replaced by the new image (the emoji) and there is nothing “behind” the emoji to be unhidden. So, you better stay away from such possibly fraudulent or shady software or tools.
Do not fall for advertisements that read like “blah blah AI will unveil the original beauty of human faces hidden behind the emoji or sticker”. Google Play Store is filled with such Android apps e.g. fastseo.

What is possible is rebuilding the missing section of the photo by guessing or taking pixels from surrounding areas of the image. The output will contain fake/blurred image parts to fill the space created by removing the emoji. That, in no way, can deliver the real image parts lost due to the addition of the emoji. You can try professional software like Fotor, AirBrush, and other photo eraser tools including Adobe tools.

I hope this helps you understand what to expect from an emoji cleanup tool or software. You can make the ugly emoji go, but you can not get the image part that was there before the emoji was added.

18 Comments on “Remove Emoji code from WordPress and make your website faster”

      1. Hibskb kbsi knska jksn jk sbbksjs. Js skk sb sjkania skksbkshjsi obsjb ksjoa ksbisi kanjsjosjw ksbsjskkwj ibsj jsbis jsbisnshbdhdjd kmsksjs jsbisbsksjjsbks kejeka jskoeks jksvsknwo ksnksnsk

Leave a Reply

Your email address will not be published. Required fields are marked *