WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Image caption in meta description (3 posts)

  1. Cavor
    Member
    Posted 1 year ago #

    WordPress version: WordPress 3.5.1.
    WordPress SEO version: 1.4.4
    http://www.ligneclaire.info/

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

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. level91
    Member
    Posted 11 months 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
    Member
    Posted 5 months 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

About this Topic