1

I'm trying to tailor an RSS feed so that it can be used to generate a newsletter via Digesto/Marketo. I've tried adding a custom RSS template to the site's theme - and it worked - but I can't seem to lose the site link that is added below each post. The post links are really all we need.

The link is being inserting just inside of the closing description tag. The code in my template that adds the description is:

<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>

My RSS template is a variation of wp-includes/feed-rss2.php, which uses the same code snippet.

There doesn't seem to be a way to edit the output of the_excerpt_rss - if that's even the culprit. Any help would be greatly appreciated!

1

After doing a search of all folders in the site for "the_excerpt_rss", I found a Yoast plugin file that was adding the link to each post item. In the end it was as simple as accessing a field via the dashboard > SEO > advanced and clicking the RSS tab. I emptied the field "Content to put after each post in the feed", refreshed the feed, and the link was gone. I can't believe it was as simple as that...

  • Omg. after spending 1 hour i got this solution.glad that you saved my life. +1 – Anant Singh---Alive to Die Jun 7 '17 at 9:30
0

you can use the filter to edit the output of the_excerpt_rss()

May be the following code will help you, not sure but give it a try

function removersslink( $content ) {
   $content =  '<p>' . $content. '</p>';
   return $content;
}
add_filter( 'the_excerpt_rss', 'removersslink' );
  • I think you meant to write get_the_excerpt(), but aren't you duplicating the excerpt here? – birgire Jan 13 '16 at 9:30
  • @birgire thanks for the clarification. i have edited my answer accordingly. Ya earlier i meant to say get_the_excerpt() – terminator Jan 13 '16 at 10:23
  • This didn't change the output. – heytricia Jan 18 '16 at 21:59
  • this one is not working. I just checked it – Anant Singh---Alive to Die Jun 7 '17 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.