If you want your website to be faster, you might have seen a file called “wp-emoji-release.min.js” loading on all your pages. This is part of WordPress’ emoji support, which is turned on automatically starting from WordPress 4.2.
This javascript file adds something extra to your page, making it take longer to load. Besides making your pages slower, it also does a special kind of search on the whole page, which can be hard on devices that aren’t very powerful. This makes your site even slower, especially on weaker devices.
A lot of people who use WordPress don’t really need those little pictures called emojis. Having them can actually make your website slower, so we suggest you turn them off.
Some plugins that help your site work better (like WP-Rocket) can also help you turn off emojis. If you haven’t done that yet, I’ll show you a way to use a special tool (a plugin) that stops emojis on WordPress. I’ll also tell you a small piece of code you can use in a special file (functions.php) to turn off emojis.
Disable WordPress Emojis with Plugin
To make emojis go away quickly and easily on your WordPress site, you can use a special tool called the “Disable Emojis” plugin. All you have to do is put in the plugin, turn it on, and just like that, emojis won’t show up anymore.
When you go to the “Plugins” section and then click “Add new” on your WordPress dashboard, search for “Disable Emojis.” You’ll easily find the plugin. Just tap on “Install” and then click “Activate.” This will take away emojis from WordPress.
Disable WordPress Emojis with Functions.php Code
Here’s a piece of code that you can put in your theme’s “functions.php” file. This code stops emojis in WordPress, and it’s a bit more for people who know about coding.
You can also use this same bit of code in a special tool called the “Code Snippets” plugin for WordPress. This plugin makes it simple to add these code bits to your site.
<?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();
}
}
Related Articles
Leave a Reply