I use WordPress SEO by Yoast, especially for the Google News sitemap feature.

My theme is coded in such a way that the main image of a post is also the featured image of the point (i.e. the same image, but a different size, is shown for post thumbnails). That's the design decision I had to make (for various reasons I can say here).

In case it helps, the code looks like this:

<div class="entry-content">
    <p style="text-align: center;"><?php the_post_thumbnail( 'full' ); ?></p>
    <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'reddle' ) ); ?>
    <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'reddle' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->

Here's the problem: The plugin scans for images in post_content i.e. for it to reference the images of a post in the sitemap, the images should be in post_content field for that post in the database.

And since that's not how featured images work, the main image of my post is not referenced in the sitemap.

Now, the question is -- is there a way around? I don't want to edit the plugin (unless there's no other way). Is there a way for me to get the featured image into post_content as it is shown in the code? (i.e. like <p style="text-align: center;"><img src="FEATURED IMAGE LINK" /></p>)

  • Have you looked at the code to see if there's a way to filter the output? Something like add_filter('yoast_seo_sitemap', 'my_custom_add_featured_image'); — Yoast usually does things the WordPress way, so you should probably start there.
    – jlengstorf
    May 19, 2012 at 21:48

1 Answer 1


Apparently, there's no way.

UPDATE! Joost De Valk, the author of WordPress SEO by Yoast, modified how the plugin works on my request in the plugin's support forums. So, problem solved!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.