Remove WordPress emojis script without a plugin

Since WordPress 4.2 an emojis script was added to the WordPress Core to help support displaying emojis in older browsers. The bad news is that it added another http request which, while only being 10kb in size, is an additional request which can contribute to slower load times.

Below is a simple way to remove the WordPress emojis script without using a plugin.

Before You Start

First, before you remove the WordPress emojis script, you need to do basic prep, here are some things you need to have and do:

  1. Backup your WordPress website
  2. You need SFTP/FTP access to your server files
  3. You need an SFTP/FTP Client
  4. You need a Code Editor
  5. Make a quick copy of your functions.php

Remove WordPress Emojis Script Without Plugin

Ok, now to actually removing that pesky emojis script. You just need to do the following.

  1. Open your site in your SFTP/FTP client
  2. Go to your theme folder
  3. Open your functions.php
  4. Copy your functions.php and paste in your Code Editor
  5. Add the code snippet below to your functions.php
  6. Upload and save your functions.php via your SFTP/FTP client

Backup your WordPress website

Hopefully, you are regularly backing up your WordPress website, including database and files. If not, before you go any further, I recommend that you organise a backup to be taken of your website. There are plenty of easy to use guides on how to do this online.

Open your site in your SFTP/FTP Client

I now use Transmit to access WordPress files on the website host. There are plenty of free options to choose from. It’s recommended that you use SFTP rather than FTP to access your website host files, due to the connection being encrypted. It’s similar to a HTTPS connection versus a HTTP connection, hence the ‘S’.

Go to your theme folder

After you have logged in on your SFTP/FTP Client, head to your current WordPress theme folder which is located: /wp-content/themes/theme-folder-name.

Open your functions.php

Now open your functions.php in your current theme folder. To do this you’ll need a code editor, I use Atom (and sometimes Sublime Text). Both are simple and easy to use.

Copy your functions.php and paste in a Code Editor

As a quick precaution, I would copy the contents of your functions.php file and paste it in a new tab in your text editor. If something goes wrong, you can quickly paste back the original code rather than having to restore a full backup.

Add the code below

The code below should be placed within the php tags of your functions.php file.


/* ********************************
Remove Emojis Script
******************************** */

remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );

Save and upload your functions.php

Now just save and upload your edited functions.php file. You’ve now removed the emojis script from your WordPress site.

FAQs

Here are some of the questions we get asked most about from this article, Remove WordPress emojis script without a plugin. We'll try our best to answer any relevant questions that get sent to us.

I'm unsure how to do this and having issues with removing the emojis script from my WordPress website.

If you're stuck, you should talk to a WordPress developer who can help you. If you're interested you could hire us to remove your emojis script.

Eco Friendly Company

Planting 1000s of new trees

We're passionate about taking climate action to tackle the climate and nature crisis. As a company we are planting 1000s of new trees and offsetting 100s of tons of carbon. We work with our partner Ecologi to plant trees, offset carbon, and support climate positive initiatives.

View our climate action →

WhatsApp