How to Disable Emojis in WordPress (Step by Step)

Are you looking to disable emojis on your WordPress site?

Emojis are small icons that are used to express feelings or emotions. WordPress loads additional CSS and a JavaScript file to add emoji support and some users may want to remove it to improve performance and speed.

In this article, we’ll show you how to easily disable emojis in WordPress.

How to disable emojis in WordPress 4.2

What Are Emojis?

Emojis are the tiny icons or smileys used on the internet.

Originating from Japan, emojis have made their way into the Unicode character set and are now supported by desktop computers as well as iOS and Android mobile devices.

The emojis feature was first introduced in WordPress 4.2 and the primary reason for adding this feature was to add native support for Chinese, Japanese, and Korean language character sets.

Emojis example

By default, WordPress loads an additional JavaScript file and some CSS to add emoji support.

You can see it by viewing your website’s source code or by using the Inspect tool.

Emoji JavaScript in WordPress

However, some site owners may want to disable this extra emoji support to boost WordPress speed and performance by not downloading additional code and scripts.

Note: When we say disabling Emoji in WordPress, we mean disabling the extra checks and scripts used by WordPress to handle Emojis. You can still use Emoji on your site, and the browsers that support them will still be able to display them.

Having said that, let’s take a look at how to easily disable Emoji support in WordPress.

Method 1. Disabling Emojis in WordPress Using Code

For this method, we’ll be using a custom code snippet to disable emoji support in WordPress.

You can add this code snippet to your WordPress theme’ functions.php file or a site-specific plugin. However, a tiny error in the code could easily break your website and make it inaccessible.

To avoid this, we recommend using WPCode. It is the best code snippets plugin for WordPress and offers the safest way to add custom code to your site without breaking it.

First, you need to install and activate the WPCode plugin. For more instructions, see our guide on how to install a WordPress plugin.

After activation, simply go to the Code Snippets » All Snippets page from the WordPress admin dashboard.

From here, you need to click the ‘Add New’ button at the top.

Add new code snippet

This will take you to the ‘Add Snippet’ page.

From here, take your mouse over to the ‘Add Your Custom Code (New Snippet)’ option and then click the ‘Use snippet’ button.

Click Use Snippet button

This will bring you to the ‘Create Custom Snippet’ page. You can start by typing a name for your code snippet. It can be anything you like.

After that, you need to select ‘PHP Snippet’ as your ‘Code Type’ from the drop-down menu present in the right corner.

Type a name for your code snippet and choose PHP as code type

Now all you need to do is copy and paste the following code in the ‘Code Preview’ box.

/**
 * Disable the emoji's
 */
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 betwen 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 betwen 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;
}
Paste your code snippet

After that, scroll down to the ‘Insertion’ section to choose an insert method for your code.

Simply select the ‘Auto Insert’ mode so that the code can be automatically executed on your site upon activation.

Choose Auto Insert as insert method

Now go back to the top of the page and toggle the switch on the right from ‘Inactive’ to ‘Active’.

Finally, click the ‘Save Snippet’ button to save your custom code snippet.

Click the Save Snippet button to save changes

That’s all, you have successfully disabled emojis in WordPress.

Method 2. Disable Emojis in WordPress Using a Plugin

For this method, we’ll be using a plugin to disable Emojis in WordPress.

First, you need to install and activate the Disable Emojis plugin. See our guide on how to install a WordPress plugin for more instructions.

The plugin works out of the box and there are no settings for you to configure.

Upon activation, it will automatically disable emoji support from your WordPress site.

We hope this article helped you learn how to disable Emojis on your WordPress site. You may also want to check out our guide on how to create a custom Facebook feed in WordPress and our article on how to add web push notifications to your WordPress site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Disable Emojis in WordPress (Step by Step) first appeared on WPBeginner.

How to Easily Add Emojis in Your WordPress Blog

Do you want to add emoji support to your WordPress blog?

Using emojis in WordPress is super easy because WordPress has built-in emoji support. You can use emojis in WordPress anywhere without installing any separate plugins.

In this article, we’ll show you how to easily use emojis in WordPress on different devices.

Easily add and use Emojis in WordPress

What are Emojis?

Emojis are tiny image icons that can be used in line with text to express emotions and other expressions.

Using emojis on the web

Emojis came from the textual representation of facial expressions in online communications. In the early days of the internet, text and punctuation were used to represent facial expressions, and these were called smileys.

Gradually, this evolved into graphical representations of those expressions. They were called several names Emoticons, Emojis, Twemojis, and more.

They have been around since the late 90s and were gradually adapted by different platforms on the web and mobile devices.

WordPress added support for modern emoji characters in WordPress 4.2. Before that, you needed a separate WordPress emoji plugin to add emoji on your WordPress website.

That being said, let’s look at how to add emojis in WordPress.

Using Emojis in WordPress on Windows

Simply edit the post or page where you want to insert emojis. In the WordPress content editor, click on a text area and then press the Windows + . (Period) shortcut keys on your keyboard.

Adding emojis in WordPress on Windows computers

This will bring up a popup showing emojis. You can search for emojis you want to use or browse them.

Once you have found the Emoji that you want to use, click to insert it into the text area.

Using Emojis in WordPress on Mac

Once again, you need to edit the post, page, or any other text edit area on your WordPress blog.

Click to ensure the cursor is inside a text area, and then press the Command + Control + Space keys together.

Inserting emojis in WordPress on a Mac computer

This will bring up a popup where you can browse and look for emojis. Once you find the emoji you want to use, you’ll need to double-click to insert it into your text.

Using Emojis in WordPress on iOS and iPadOS

If you are working on your WordPress website using iPhone or iPad, then you can easily switch to the emoji keyboard on your device to add emojis.

Simply login to WordPress on your iOS or iPad device. Edit the post or page where you want to use emojis and tap on a text area. You’ll now see the native keyboard appear on screen.

Emoji button in iOS

Now tap the Emoji button to switch to the Emoji keyboard. Your device will show emojis that you can add.

iOS emoji keyboard

You can browse emojis by category or search for an emoji icon. Once you have found the emoji, simply tap to insert it into your post.

You can then tap on the ABC button to switch back to the text keyboard.

Using Emojis in WordPress on Android

Android phones and tablets also come with built-in support for emojis.

Simply edit the WordPress post or page where you want to use emojis. On the edit screen, tap on a text area and your device’s native keyboard will appear.

On the keyboard, tap on the Emoji button to switch to the Emoji keyboard.

You’ll now see the emoji keyboard where you can search or browse to find the emoji that you want to add.

Android Emoji keyboard

Simply tap on the emoji to add it to your WordPress post.

You can switch back to the text keyboard by taping on the ABC button.

How to Disable Emoji in WordPress

You can turn off Emoji support in WordPress by using the Disable Emojis plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Disable Emojis plugin disables Emoji functionality in WordPress. However, you can still add emojis in all modern web browsers.

The plugin only disables the DNS prefetching of emojis within WordPress. This is done to improve privacy and make a WordPress website more GDPR compliant.

We hope this article helped you learn how to use Emojis support in WordPress. You may also want to see our beginner’s guide to WordPress keyboard shortcuts or see our pick of the most useful WordPress plugins for all websites.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Easily Add Emojis in Your WordPress Blog first appeared on WPBeginner.