WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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>)

share|improve this question
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 '12 at 21:48
up vote 0 down vote accepted

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!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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