Title: Remove Caption Shortcode from the_content_rss &#8230; ?
Last modified: August 19, 2016

---

# Remove Caption Shortcode from the_content_rss … ?

 *  [chazbeaner](https://wordpress.org/support/users/chazbeaner/)
 * (@chazbeaner)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/remove-caption-shortcode-from-the_content_rss/)
 * Anyone know how to strip the caption shortcode from the_content_rss output? HTML
   markup for the img itself gets stripped, but the caption shortcode remains…
 * I have tried strip_shortcode, remove_shortcode, remove_all_shortcode but to no
   avail.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [husklynet](https://wordpress.org/support/users/husklynet/)
 * (@husklynet)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/remove-caption-shortcode-from-the_content_rss/#post-1209837)
 * I am also in need for a solution to this problem. I have an XML-file a partner
   needs to use, but I can’t seem to get rid of the [caption]-part of posts with
   images in them.
 * Does this require some preg_replace or something? If so, can anyone point me 
   in the direction of a solution?
 *  [careybradfield](https://wordpress.org/support/users/careybradfield/)
 * (@careybradfield)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/remove-caption-shortcode-from-the_content_rss/#post-1209839)
 * this was posted somewhere else:
 * add to the feed.php file
 * $content = apply_filters(‘the_content_rss’, $content); /* already was there, 
   here is for navigation. it’s near 164 line */
    $content = preg_replace(“/\[caption.*\[\/
   caption\]/”, ”, $content); /* string itself */ if ( $cut && !$encode_html ) /*
   next line, for navigation too */
 *  [Joyful Thiek](https://wordpress.org/support/users/jothiek/)
 * (@jothiek)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/remove-caption-shortcode-from-the_content_rss/#post-1209848)
 * I’m having the same problem. And I’d like to try the code given above too, but
   only thing is I can’t find a feed.php. Help anyone?
 *  [kestrel_id](https://wordpress.org/support/users/kestrel_id/)
 * (@kestrel_id)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/remove-caption-shortcode-from-the_content_rss/#post-1209869)
 * @craybradfield Thanks for the Regex solution you posted it works a treat.
 * I had to use the Regex after I found the the WP Codex function strip_shortcodes
   function leaves the closing shortcode tag for some unknown reason [/caption]
 * Has anyone else come across this and perhaps have a theory as why this is happening?
 *  [joneslee85](https://wordpress.org/support/users/joneslee85/)
 * (@joneslee85)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/remove-caption-shortcode-from-the_content_rss/#post-1209880)
 * [@kestrel_id](https://wordpress.org/support/users/kestrel_id/): I confirmed this,
   I have to do a str_replace(“[/caption]“, ”, $content) to get rid of this. This
   could be a bug. Can someone confirm?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Remove Caption Shortcode from the_content_rss … ?’ is closed to new replies.

## Tags

 * [caption](https://wordpress.org/support/topic-tag/caption/)
 * [remove](https://wordpress.org/support/topic-tag/remove/)
 * [RSS](https://wordpress.org/support/topic-tag/rss/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [strip](https://wordpress.org/support/topic-tag/strip/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 6 participants
 * Last reply from: [joneslee85](https://wordpress.org/support/users/joneslee85/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/remove-caption-shortcode-from-the_content_rss/#post-1209880)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
