Yoast SEO
Image caption in meta description (3 posts)

  1. Cavor
    Posted 2 years ago #

    WordPress version: WordPress 3.5.1.
    WordPress SEO version: 1.4.4

    How Can I remove caption text (<p class="wp-caption-text">) wich appears in meta description if I put a picture before text ?


  2. level91
    Posted 2 years ago #

    I would also like to know how this can be avoided.

    It's possible to override the description text template on a per-page basis using the Yoast Meta Box on the page/post editor screen.

    However if the plugin could be smart enough to disregard any text in captions all together that'd be great.

  3. SG213
    Posted 1 year ago #

    I'm not use Yoast but I had to do something similar with the Zoom Framework SEO settings.

    It boiled down to using something like this in the function where the meta descrption is being create:

    // remove [caption] shortcode
    $content = preg_replace("/\[caption.*\[\/caption\]/", '', $post->post_content);

    Various other processing is then done to $content before being output in the meta description tag.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic