Support » Plugin: Yoast SEO » sitemap: attachment-sitemap.xml submitted and indexed

  • Resolved ralfv


    hello yoast,

    i have your plug inn installed on a few sites,
    first thank you for providing such a great SEO plug inn,
    and all your useful tips.

    I have installed yoast SEO plug inn on 2 small blogs, each blog about 30 posts & pages

    2 days ago, I have found all of a sudden over 700 pages were indexed, ( 100s of media attachment pages , attachment-sitemap.xml, was submitted automatically to google, this sitemap— these media attachment pages are just a image , this is thin content in googles eyes. Will it effect my SEO?

    I haven’t touched my Yoast SEO setting in month, everything was fine.

    But when I updated to the new Yoast 7.0.3 version, something changed automatically and this attachment-sitemap was provided to google

    when I understand correctly setting should be:
    under – search appearance – media – Media & attachment URLs – set to “yes”
    I want that my blog posts & pages & images are indexed, nothing else
    ( but when I updated to the new version, these setting were set to “No” )

    my question is:
    What should I do, change these mentioned settings above to “YES”, and
    submit a new sitemap to google??

    please let me know,

    Best Regards, Ralf

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support devnihil


    @ralfv If you are wanting to set your media attachment pages to be indexed, but not have them included in the sitemap, you’ll need to manually do that by using the wpseo_sitemap_excluded_posts filter to to exclude them from the sitemap. As the setting for ‘Show Media in search results?’ for Media & attachment URLs simultaneously either includes them in the sitemap and are set to be indexed, or when set to ‘No’ it sets them to ‘noindex’ and does not include them in the sitemap.

    In regards to your question, if you do not want the attachment pages to be indexed you would want to set ‘Redirect attachment URLs to the attachment itself?’ to Yes. As for the sitemap, if you do not want the attachment sitemap created you would need to set the ‘Show Media in search results?’ for ‘Media & attachment URLs’ to ‘No’ and this will remove the attachment pages from the sitemap. After which you can then resubmit the sitemap to Google.

    Thread Starter ralfv


    @devnihil yes, thank you for your response
    I have changed the settings, and attachment pages are removed from the sitemap.
    resubmitted a new sitemap, it should be alright now.

    again thank you, Ralf

    Plugin Support Michael Tina


    We’re setting this topic to resolved. Thanks!

    I’d like to reopen this thread because I have some doubts about the said update. Let me tell you I have been using Yoast for yeeeeears now and wouldn’t change it for another one.

    I have a few things to ask.

    1. If we set “Redirect attachment URLs to the attachment itself?” to YES, then we do not have the option to set the ‘Show Media in search results?’ to NO or anything, since it doesn’t show (due to having set the previous one to YES).

    2. I want to ensure that I’m going to do the right thing, so let me explain.

    If I search a keyword “coaching gerontologico minchelod” in Google, one the results is ok, the page that is meant to show. But there is another result which is generated by an attachment URL.

    I think that showing this type of result isn’t user-friendly (directing the user to an image in a mostly blank page? What for?) So I don’t want that result to show in the “general” Google results, although of course I do wnat Google to index it in Google images.

    How do I set up the MEDIA TAB then? I understood that I should set it up NO and NO in both cases?

    If I set “Redirect attachment URLs to the attachment itself?” to YES, I understand that it will continue to show the result of an image URL in Google, which is, as I said, absurd. However I do want the image to be indexed for Google images as it should be.

    3. Last thing. Once I have re-set the settings in MEDIA tab, do you have an idea of approximately how long will it take Google to show the correct results? One day? 7? 30? I really don’t want to see those attachment URLs in SERPs ever again!! 🙂

    This is a MASSIVE issue with disastrous SEO implications.

    the original setting Yoast SEO “Redirect attachment URLs to parent post” is gone after one of the updates.

    The Yoast plugin is now allowing an indexing of a lot of thin content pages by default. In my site the attachment redirect to original post was completely gone after the upgrade. This resulted in 4000 indexed pages with thin content. Essentially most of the indexed pages of my site became thin content which is a big NO NO.

    Only discovered this issue after a massive drop in ranking and traffic.

    Even redirection to attachment URL is just adding tons of fluff to the Google index which is really bad practice.

    This is a HUGE issue – having it in a plugin that should help SEO is a disaster to a lot of websites.

    As a side note Yoast SEO is quickly becoming a bloatware with lots of options that are not really required. I don;t understand why the option has been removed.

    There is a manual code fix in GitHub

    As a temporary solution, turn off the “Redirect attachment URLs to the attachment itself?” option and use the following code in your functions.php file:

    add_action( ‘template_redirect’, ‘sukcesstrony_attachment_url_redirect’ );

    function sukcesstrony_attachment_url_redirect(){
    global $post;

    if ( is_attachment() && isset($post->post_parent) && is_numeric($post->post_parent) && ($post->post_parent != 0) ){
    wp_redirect( get_permalink( $post->post_parent ), 301 );


    Thread Starter ralfv



    today, I have found in my newsletter a post from yoast
    it explains the whole thing ( there was a bug in a yoast plug inn, its fixed now)
    but you need to look at your settings, it is important

    read the post below



Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘sitemap: attachment-sitemap.xml submitted and indexed’ is closed to new replies.