Snippet: Remove Smile Emojis
Important: WordPress no longer does this on new installations! And for old installations, you can now disable this via WordPress under Settings > Writting > Convert emoticons like :-) and :-P to graphics on display.
By default WordPress converts :) into a smile emoji on the frontend. The following code disables the conversion so that it will still render as plain text.
/**
* Remove Smile Emojis
*
* @link https://totalwptheme.com/docs/snippets/remove-smile-emojis/
*/
add_action( 'init', function() {
remove_filter( 'the_content', 'convert_smilies', 20 );
remove_filter( 'wpex_the_content', 'convert_smilies', 20 );
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
We recommend Code Snippets (100% Free) or WPCode (sponsored)