Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Created November 20, 2013 14:56
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 jdevalk/82708afec878e930a905 to your computer and use it in GitHub Desktop.
Save jdevalk/82708afec878e930a905 to your computer and use it in GitHub Desktop.
This removes both the excerpt and the longer encoded content from the RSS feed.
<?php
/**
* Removes the content from the RSS feed and replaces it with a custom message.
*
* @param string $content
*
* @return string
*/
function yst_clean_rss( $content ) {
if ( is_feed() )
return 'This is a new post on yoast.com, Whoopity Doo!';
return $content;
}
add_filter( 'the_content_feed', 'yst_clean_rss', 90, 1 );
add_filter( 'the_excerpt_rss', 'yst_clean_rss', 90, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment