Skip to content

Instantly share code, notes, and snippets.

@ngearing
Created June 8, 2018 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngearing/850ff76dc0e3e6ec8d7506d9e847f9b3 to your computer and use it in GitHub Desktop.
Save ngearing/850ff76dc0e3e6ec8d7506d9e847f9b3 to your computer and use it in GitHub Desktop.
Remove Missing Attachment text from WordPress feed
<?php
/**
* Remove text from rss feed content and excerpt.
*
* @param string $content
* @return string
*/
function remove_feed_text( $content ) {
// Replace 'Missing Attachment' text.
$content = str_replace( 'Missing Attachment', '', $content );
return $content;
}
add_filter( 'the_excerpt_rss', 'remove_feed_text', 10, 1 );
add_filter( 'the_content_feed', 'remove_feed_text', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment