attempting to filter out partial post from RSS feed
-
Hey everyone. Thanks in advance for taking a look at this.
Here’s what I’m trying to do. I want to prevent this show’s transcript from being included in the RSS feed. I had found this on SO:
<a href=” https://stackoverflow.com/questions/29934846/exclude-part-of-a-wordpress-post-from-appearing-the-rss-feed”>
https://stackoverflow.com/questions/29934846/exclude-part-of-a-wordpress-post-from-appearing-the-rss-feedWhere they suggest making the following changes to the functions.php file. I’m making these to the theme’s child functions.php file.
add_filter( "the_content_feed", "filter_away_embed_function" ); function filter_away_embed_function($content) { $content = preg_replace('#(<embed.*?>).*?(</embed>)#', '$1$2', $content); return $content; }
However, what’s happening is the the full transcript is still being included in the RSS feed, and my closing tag is getting included in the feed.
Friends, we want to encourage you to please follow us wherever you listen to this, whether it’s on the Apple Podcasts app, iHeartRadio, Spotify, or one of the other platforms.<br /> You guys, it’s completely free. And while you’re there, feel free to give us a rating or a nice review.<br /> Thank you for listening to Tell Us a Good Story.</p> </div> <div id="transcript" class="transcript-base"></div> <p><span style="color: initial; font-size: revert;"></div></span><br /> </embed></p>
I’m hiding the post on the page using collapse-o-matic plug-in, and I thought that might be causing the issue..but even with it disabled, and the smartcodes removed from the post, it’s still occurring.
Website is using PHP version 8.0.30 (Supports 64bit values)
WP version 6.3.2Any ideas?
The page I need help with: [log in to see the link]
- The topic ‘attempting to filter out partial post from RSS feed’ is closed to new replies.