• Hi there,

    It seems like some shortcode styling changed, but as I completely removed captions in the past, I’m only running into problems now.

    In short: how can I remove the caption from my RSS, in such a way that I do keep the image with it’s information? I’ve found some suggestions, to use:
    $content = preg_replace("/\[caption.*\[\/caption\]/", '',$content);

    But as the complete shortcode now seems to have changed to:

    [caption id="attachment_80695" align="alignnone" width="1024"]<a href="http://domain.com/wp-content/uploads/2015/09/img.jpg"><img class="wp-image-80695 size-full" src="http://domain.com/wp-content/uploads/2015/09/img.jpg" alt="The caption text" /></a> The caption text[/caption]

    this does not (seem to) work anymore, as everything between the [captions] is removed. I don’t mind the “alt” tag, I just need to get rid of the last instance of “The caption text” in the above example. (+ Ideally, get rid of the [caption] tags as well)

    edit: I figure:
    $content = preg_replace("/a\>.*\[\/caption\]/", 'a>[/caption]',$content);
    will work, but it seems bit nasty.
    Any trouble I could run into, there?

  • The topic ‘Remove Image Captions from RSS’ is closed to new replies.