How do I disable WordPress emojis?

Sommaire

Procédure

Emojis, icons that represent various emotions, are natively supported by recent browsers and devices. By default, WordPress also adds a JS and CSS file to improve this support and ensure the correct display of certain types of emoji, in particular Asian character sets (Chinese, Japanese, Korean). If your site doesn't need this support, or you want to improve performance a little, you can choose to deactivate them, so that WordPress no longer downloads these additional files.
Don't worry, deactivating this option will not prevent you from using emojis on your site, only the additional WordPress support will be deactivated.

There are two ways to disable emoji support: by adding a custom function to your site or by using an extension that will do it for you.
To disable emojis, you can add this piece of code to your WordPress site, which will take care of disabling support throughout your site:

add_filter('init', function() { remove_action('wp_head', 'print_emoji_detection_script', 7); remove_action('wp_print_styles', 'print_emoji_styles');
   remove_action('admin_print_scripts', 'print_emoji_detection_script'); 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('wp_resource_hints', function ($urls, $relation_type) { if ('dns-prefetch' == $relation_type) { $urls = array_diff($urls, array(apply_filters('emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/'))); } return $urls; }, 10, 2); // Disable the TinyMCE emoji script add_filter('tiny_mce_plugins', function ($plugins) { return is_array($plugins) ? array_diff($plugins, array('wpemoji')) : array(); }); });


To add custom code to your site, you can follow our documentation, which will guide you through the process step by step.

If you don't want to or can't add code to your site manually, you can also use an extension that will automatically disable emoji support. Many optimisation extensions offer this feature in addition to their main functions, such as LWS Optimize, an extension made by LWS.


Disabling WordPress emojis with LWS Optimize


To disable emojis from our extension, simply go to its settings and then to the "Front-End" tab:

How do I disable WordPress emojis?How do I disable WordPress emojis?

Here, find the "Disable WordPress Emojis" action and tick it.

How do I disable WordPress emojis?

And that's it, emoji support has been deactivated for your site. Deactivation takes place without any further action on your part and should not cause any visual problems on your site, however it is possible that some of the emojis you use on your site may act abnormally as a result. If this happens to you, you can attempt to modify the affected pages to replace the faulty emojis or simply disable the action, which is clearly not compatible with your site.

LWS Optimize comes directly with the file cache activated by default. If this has already cached the pages on your site, you won't see any changes as a result of deactivating emoji support. You will then need to purge this cache so that the changes take effect on the pages of your site. To do this, go to the "Caching" tab and click on the "Empty cache" button next to the "Manual purge" action:

How do I disable WordPress emojis?How do I disable WordPress emojis?

Conclusion

You now know how to optimise the performance of your WordPress site by disabling 👍 emoji support. You've learned how to do this manually by adding a piece of code to your site, or automatically using an extension such as LWS Optimize. What's more, you're able to resolve any visual issues that may arise after this deactivation and manage the cache purge so that the changes are effective 🚀.

We hope this article has been useful and helped you understand the importance of emoji management for your website's performance. Thank you for reading and please feel free to leave a comment to share your experience or ask any questions about the 📝 service. Your feedback is important to us and to the community!

Rate this article :

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

2mn reading

How do I install the LWS affiliate plugin on WordPress?

3mn reading

How do I install the LWS SMS plugin for WooCommerce on WordPress?

0mn reading

How do I clean my WordPress site with LWS Cleaner?

0mn reading

How can LWS tools make managing WordPress easier?


Ask the LWS team and its community a question