Stop Converting Text Smileys to Images
Leaves text like :) and ;-) as typed instead of replacing it with smiley images or emoji.
Opens WPIDE on
Code
add_filter( 'pre_option_use_smilies', function () {
return '0';
} );
add_action( 'init', function () {
remove_filter( 'the_content', 'convert_smilies', 20 );
remove_filter( 'the_excerpt', 'convert_smilies' );
remove_filter( 'comment_text', 'convert_smilies', 20 );
remove_filter( 'widget_text_content', 'convert_smilies', 20 );
remove_filter( 'the_post_thumbnail_caption', 'convert_smilies' );
} );
Notes
Emoji you type directly are not affected; use the emoji snippet to stop the emoji script.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.