Support » Fixing WordPress » caption shortcode shows up in excerpt (2.9.1)

  • I include images with each post. I insert them using the ‘add an image’ button with the visual editor in HTML mode. The images are inserted from my media library.

    Once the entry is posted, the short version (excerpt) of the post contains the caption text of the image. Since the image itself isn’t displayed in the excerpt, this doesn’t make sense.

    Sample excerpt (emphasis added here – that’s the tag from the image):

    cc-by:Flickr:penmachineThe video blah blah blah…

    I have to create an excerpt manually. Is there any way to prevent this issue? I’d even be willing to attempt editing a function, but that’s probably beyond my skill level.

Viewing 1 replies (of 1 total)
  • You could apply the the_excerpt filter to the post content, manually shorten the length of the content, and hook a priority 1 filter to it that will remove shortcode from the content.

Viewing 1 replies (of 1 total)
  • The topic ‘caption shortcode shows up in excerpt (2.9.1)’ is closed to new replies.