Rate this article :
This article was useful to you ?
Yes
No
Vous avez noté 0 étoile(s)
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.
To disable emojis from our extension, all you need to do is go to its settings, in advanced mode via the dedicated button and then to the "Front-End" tab:
Here, find the "Disable WordPress Emojis" action and tick it.
Then confirm the changes using the "Save new configuration" button at the bottom right.
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 try to modify the affected pages to replace the faulty emojis or simply deactivate the action, which is obviously not compatible with your site.
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 problems that may arise after this deactivation 🚀.
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 questions about the 📝 service. Your feedback is important to us and to the community!
Rate this article :
This article was useful to you ?
Yes
No
0mn reading
How can I minimize the files on my WordPress site with LWS Optimize?
0mn reading
How can I combine the files on my WordPress site with LWS Optimize?
0mn reading
How do I preload CSS files on my WordPress site with LWS Optimize?
0mn reading
Lazy Loading WordPress: boost your site's performance with LWS Optimize