WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

Hay, does anyone know a way to display the featured image url within the RSS feed?

share|improve this question
up vote 4 down vote accepted
function add_featured_image_url($output) {
    global $post;
    if ( has_post_thumbnail( $post->ID ) ){
        $output = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ) . ' ' . $output;
    return $output;

add_filter('the_excerpt_rss', 'add_featured_image_url');
add_filter('the_content_feed', 'add_featured_image_url');
share|improve this answer
I've added this to my templates functions.php file, but when i read the feed i cannot see it. Do i need to do anything else to it? – dotty Sep 7 '10 at 14:31
Oh, a follow up. I'm using php's SimpleXmlElement() and reading the file through that. Will that make a difference? – dotty Sep 7 '10 at 14:39
... nope reply. any ideas? – dotty Sep 9 '10 at 13:22
I missed you previous comments. There was an error in my answer, I edited it. – sorich87 Sep 9 '10 at 16:13
Sorich I think there's still an error, the code above will remove the post content and replace it with the url instead of adding it. Needs to be $output .= wp_get_att[...] instead of = – jeremyclarke Sep 11 '10 at 21:12

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.