Shortcode appearing in RSS feed

Hi there,

I have tried some of the solutions in this thread related to this issue, however my reader is still pulling the shortcodes into my feed.

An example of the code being pulled in is as follows-
[cs_element_section _id=”1″][cs_element_row _id=”2″][cs_element_column _id=”3″]

I have tried the following solution, however it didn’t help-

 add_filter('the_excerpt_rss', 'x_custom_feed');
add_filter( 'the_content_feed', 'x_custom_feed' );
function x_custom_feed( $content ){
	global $post;

	if ( ! is_feed() )
		return $content;

	// Remove all shortcodes
	$content = strip_shortcodes( $post->post_content );

	return $content;
}

Hi There,

Please try updating your custom code to this:

add_filter('the_excerpt_rss', 'x_custom_feed');
add_filter( 'the_content_feed', 'x_custom_feed' );
add_filter('the_excerpt', 'x_custom_feed');
add_filter( 'the_content', 'x_custom_feed' );
function x_custom_feed( $content ){
	global $post;

	if ( ! is_feed() )
		return $content;

	// Remove all shortcodes
	$content = strip_shortcodes( $post->post_content );

	return $content;
}

Hope it helps :slight_smile:

I updated it but now it only shows a short form of the post being only the title.

Hello There,

The feed is supposed to display excerpts. Excerpts were dynamically generated from the very first 55 words of the post by default. When the post content is wrapped with a shortcode like the Cornerstone or VC formatting shortcodes, no excerpts will be generated. To resolve this issue, you must insert a manual excerpts instead. Manual Excerpts are optional hand-crafted summaries of your content that can be used in your theme. Learn more about manual excerpts.1

Please check out this thread for reference: https://theme.co/apex/forum/t/post-excerpt-are-not-being-pulled-through-cornerstone-and-wpbakery-page-builder/221322

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.