WordPress emojis are excellent for expressing your feelings. However, they are unnecessary for your WordPress site.
Fortunately, the process to disable emojis in WordPress is effortless. It all becomes possible with the help of a plugin, and if you are a technical person, you can prefer using a simple code in your function.php file.
So, in today’s quick guide, we will take a closer look at why and How to disable emojis in WordPress.
Let’s dive in.
Why Should You Disable Emojis in WordPress?
Following are the reasons why you should consider removing emojis in WordPress.
- They are unnecessary for your site and can end up slowing down the site.
- If your user is using low power devices, he is likely to suffer more with it. That’s why you should consider removing emojis in WordPress.
- Each time, emojis will create additional HTTP requests on the site.
- Emojis usually cause you to add unnecessary files in Javascript.
- The kick-off size of the emoji file is usually between 10 to 10.5 KB. However, it tends to increase each time.
The Simplest Ways to Disable Emojis in WordPress:
Before we dig into how to disable emojis in WordPress, you must know that
It’s about disabling all those scripts and additional checks that WordPress uses. However, you can still use emojis, and the supporting browser will be able to show on your site.
So, let’s dive deeper and find out our two tested methods to disable emojis in WordPress.
With Plugin:
One of the quickest ways to disable emojis in WordPress is by using a plugin, especially if you are a non-tech person.
However, the one we recommend is “Disable Emojis (GDPR friendly)”.
It is one of the easiest plugins to configure; all you need to do is install and activate the plugin. Perform a bit of configurations and that’s it, emoji support will be gone.
Function.php Code:
If you are a bit of a technical person, we won’t recommend you use plugins for such tiny tasks. Instead you should prefer using a small code in your function.php file.
For instance, if you have a developer-friendly approach, then all you need is to place the below-mentioned code in your function.php file. Source: GitHub
<?php
//Disable emojis in WordPress
add_action( 'init', 'smartwp_disable_emojis' );
function smartwp_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_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
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' );
}
function disable_emojis_tinymce( $plugins ) {
if ( is_array( $plugins ) ) {
return array_diff( $plugins, array( 'wpemoji' ) );
} else {
return array();
}
}
On the contrary, if you are a noncoding person, we would highly suggest you use a plugin named “WPCode” to embed snippets. Fortunately, it is one of the safest ways to make changes on the site without creating any mess.
For this, all you need is to;
- Install and activate the plugin “WPCode”
- Go to the code snippet and click on add snippets.
- Next, click on the “use snippet button” to add your custom code.
- A page will appear where you will begin the process by assigning the code type and name.
- It’s time to copy the code mentioned above.
- After that, paste the code in the “code preview” box.
- Now, you can scroll down to choose your code insertion method. We recommend you go for an auto-insert option.
- Scroll to the top of the page and change the code position from inactive to active.
- Don’t forget to save snippets to disable emojis in WordPress successfully.
If you are not comfortable with doing any of the methods mentioned above, you can provide this code to your developer, and he will embed the code.
Final Thoughts:
Disabling emojis in WordPress is a simple yet effective strategy to improve site performance or speed. We have been using this practice for years and recommended it to you as well.
However, editing the theme source code can also break your site if not done properly. That’s why, if you have never done this before, we would highly encourage you to see the developer first.
In case you need any help, you can also reach out to us using our Contact Us page or comment below.
Till Next!
- How to Hide Page Title in WordPress Elementor (2 Simple Methods) - December 21, 2024
- How to Rename Images in WordPress (Change After Uploading) - December 20, 2024
- Kinsta Alternatives: 10 Best Kinsta Replacements - December 20, 2024