Remove image caption from post excerpt

I am currently using a wordpress plugin called “limit-posts” to better customize my post excerpts. The only issue I have is the excerpt is including the caption text from the image that is within the post.

I can see in the code that all captions are enclosed in tags

Read More

Is there a way I can strip out the any content within em tags from the post excerpt?

Here is a link to the current plugin in use – http://labitacora.net/comunBlog/limit-post.phps

Thank you very much

Related posts

Leave a Reply

3 comments

  1. I’d not use something like this at all. There are plenty of hooks for content and excerpt retrieval to use, I see absolutely no need to drop native functions in favor of something else.

    You can use excerpt_length filter to change excerpt length (in words) or the_excerpt to make changes to excerpt’s text before output.

    If I may ask – what is your technical level with WordPress? Do you want some code examples for this? If so please write out how exactly you want excerpt modified.

  2. You can always simply hide it with CSS.
    It’s not a perfect solution but may be sufficient for your case.

    CSS class of the caption paragraph is .wp-caption-text