Disable emojis in WordPress

The easiest way to disable emojis in WordPress

WordPress is a powerful CMS that includes a plethora of features that allow users to easily and creatively build and manage a website. The ability to use emojis in your content is one such feature. Emojis can add a personal touch and playfulness to your website. However, they can also slow down your site’s loading speed, which can impact your website’s SEO negatively. If you’re looking to improve your website’s performance, you may want to disable emojis on your site. In this article, we’ll go over the steps you need to take to disable Emojis in WordPress.

So, hang on and read the blog till the end!

Emojis Icons in WordPress: What You Need to Know 

Emojis are small attractive icons that we can use to express our emotions and sentiments. The emoji feature was first released with WordPress 4.2 version, and WordPress loads additional JavaScript and CSS files by default to add emoji support. The feature was a fun and engaging addition, but it can hamper the website’s loading speed and performance.  

As a result, many website owners wish to disable emojis in WordPress in order to improve a website’s performance and loading time.

In addition, it’s also worth noting that disabling emojis in WordPress don’t prohibit you from utilizing them on your site. Removing emojis in WordPress only disables the extra checks and scripts that WordPress employs to handle emojis. You can still use it on your website, and browsers that support emojis will display it.

Ways to disable emojis in WordPress

Until now, you may have understood how and when the emoji feature was incorporated into WordPress and why you may need to disable it. So, without further ado, let’s dive into the two different and easy methods to disable emojis in WordPress. 

1. Disable emojis in WordPress using a plugin 

2. Disable emojis in WordPress using a code

Let’s discuss each method one by one.

1. Disable emojis in WordPress using a plugin 

This is the most basic, simplest, beginner-friendly, and recommended method to disable emojis in WordPress. There are many plugin options in the WordPress repository, free as well as paid, for disabling emojis in WordPress. But, to cut down your search, we’ll use a free plugin by Ryan Hellyer named ‘Disable Emojis.’

The plugin is extremely lightweight and straightforward to use, with a five-star rating and over 70,000+ active installations.

The plugin merely eliminates the extra JavaScript file needed to enable emoji compatibility in earlier browsers, and emoticons and emojis will continue to work in browsers that support them natively.

How to get started with the ‘Disable Emojis’ plugin?

To begin, first, you need to Install and Activate the Disable Emojis Plugin on your WordPress. For this, you can follow the below stated steps, or you can refer to our detailed guide on easy plugin installation if you are new to it.

  1. Head over to the ‘Plugins’ section of your WordPress admin dashboard.
  2. Click on ‘Add New.’
  3. In the search bar, type in ‘Disable Emojis.’
  4. Click on “Install Now” and then ‘Activate.’

That’s it. You’ve successfully activated the plugin on your site. And you are done! The plugin will automatically disable emoji support from your WordPress site after activation, and the additional JavaScript file will be gone.

Yes! That’s right. This simple plugin works out of the box, and you don’t need to configure plugin settings.

Other Plugin Alternatives

Another effective as well as free plugin option is Emoji settings.

This plugin was designed with Multisite in mind, and the user has the option to disable Emojis.

You can install and activate it in the same manner described above.

Upon activation, users can enable or disable “Enable emoji support” from the Writing settings in their WordPress dashboard.

2. Disable emojis in WordPress using a code

The next method to disable emojis in WordPress is by using a code snippet. You need to add the code to your WordPress theme ‘functions.php’ file, or you can simply use a site-specific plugin. 

Remember that even a small error in this code can break your website. That is why it is crucial to follow this method wisely. 

To avoid major problems, you can use the WPCode plugin. It’s an effective code snippet plugin that allows you to add code to your site safely without making any mistakes. 

So, in order to disable emojis in WordPress using code, first install and activate the WPCode plugin.

Then, navigate to your admin dashboard and head over to Code Snippets>> All Snippets page.

Now, click on the ‘Add New’ button. On the next screen, you’ll witness the ‘Add Snippet’ page.

Now, hover over your mouse to the ‘Add your Custom Code (New Snippet)’ option and then click on the ‘Use Snippet button.’

Then, you will be directed to the ‘Create Custom Snippet’ page. There, first, enter a name for your code snippet(anything your like) and then click on the ‘Code Type’ drop-down menu. From there, select the ‘PHP Snippet’ option to proceed. 

After that, copy and paste the given code snippet in the ‘Code Preview’ box.

 


 /**

 * Disable the emojis

 */

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' );

 add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );

 add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 );

}

add_action( 'init', 'disable_emojis' );

 

/**

 * Filter function used to remove the tinymce emoji plugin.

 * 

 * @param array $plugins 

 * @return array Difference between the two arrays

 */

function disable_emojis_tinymce( $plugins ) {

 if ( is_array( $plugins ) ) {

 return array_diff( $plugins, array( 'wpemoji' ) );

 } else {

 return array();

 }

}

 

/**

 * Remove emoji CDN hostname from DNS prefetching hints.

 *

 * @param array $urls URLs to print for resource hints.

 * @param string $relation_type The relation type the URLs are printed for.

 * @return array Difference between the two arrays.

 */

function disable_emojis_remove_dns_prefetch( $urls, $relation_type ) {

 if ( 'dns-prefetch' == $relation_type ) {

 /** This filter is documented in wp-includes/formatting.php */

 $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/' );

 

$urls = array_diff( $urls, array( $emoji_svg_url ) );

 }

 

return $urls;

}

Then, look for the ‘Insertion’ section and choose an insert method for your code. 

Select the ‘Auto Insert mode’ to automatically execute the code on your site.

Then, scroll up to the top of your page. Now switch the ‘Inactive” toggle to Active’ and then click on the ‘Save Snippet’ tab to save your custom code. 

That’s it. This code will simply disable the emojis in WordPress.

Final Thoughts:

So this was all about how you could easily disable emojis in WordPress. Emojis can be a fun way to make your content interesting and attractive. However, the additional JavaScript and CSS files can slow down your website’s loading speed. If you’re looking to improve your website’s performance, you might consider disabling Emoji in WordPress. In this blog, we’ve outlined two different but easy methods to disable emojis in WordPress in a step-by-step manner. By obeying the steps outlined in this blog, you’ll be able to easily disable emojis in WordPress. We hope this easy guide has helped you learn the easy process and assisted you in disabling emoji support on your website.

Read also: How to disable Automatic Formatting in WordPress.

Read also: How to disable HTML in WordPress Comments.

Leave a Comment