Disable WordPress emojis in RSS Feed

I've had an issue with my RSS feed and the emoji images WordPress replaces by default.

My content had emojis, so they would get replaced to images in the feed. Then, Mailchimp would use width: 100% on all images from my posts. Which, when you think about it, is great because it makes sure my images look good in desktop and mobile (email clients).

The issue was, the emoji images would also get a wide width. As you can imagine, the emoji images were massive.

To fix that, I've created a super straight forward plugin with help from Stack Overflow.


/*
Plugin Name: Disable Emoji Images in Feed
Plugin URI: http://php.quicoto.com
 * Description: It disabled the emoji images convertion leaving the original emoji character. I want to prevent Mailchimp from showing them full width
 * Version: 1.0
 * Author: quicoto
 * Author URI: http://php.quicoto.com
*/


function disable_wp_emojicons() {
  remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
  remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
}

add_action( 'init', 'disable_wp_emojicons' );
</code>

You can filter it everywhere if you need to: https://wordpress.stackexchange.com/questions/185577/disable-emojicons-introduced-with-wp-4-2

About Rick

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.
2 comments

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*