Duplicate Content Warning: when media attachment files index

Recently there have been reports of  WordPress websites indexing media attachments as pages on their own. This is a problem as it creates duplicate content on your site.

Normally you can redirect these images back to the parent page (ie, the actual blog page) but nowadays this option is nowhere to be found with the free version of Yoast.

Where did you go oh faithful redirect option in Yoast?


[su_box title=”The issue as been brought up in multiple locations online” color=”#3a80f1″]

On Github

And Quora

Read Gulshan Kumar‘s answer to How do I prevent google from indexing my website’s WordPress Image Attachment Pages? on Quora[/su_box]


There are multiple solutions suggested for the problem. However, one warning from most in the know is that you should never handle the issue via robots.txt.

[su_note]Update: A very easy fix popped up which renders this a minor issue from now on. Take that YOAST![/su_note]

The easy steps to fixing the duplicate media attachment file issue.

After completing these steps, media attachments should not be a problem any longer. They simply won’t index.

  1. Find your xml sitemap and confirm that it has an xml url with the following: /attachment-sitemap.xml. If you see this you will need to request deindexing.
  2. Make a list of all the urls in the xml file by opening the sitemap for inspection.
  3. Collect the urls for submission in your search console/ webmaster tools. Not sure where that is? Check here.
  4. Install the bulk removal plugin on your site so that the files do not come up when your site is reindexed.

Why is this such a priority for SEO? Google will be unable to access the page to deindex it. You will hurt yourself twice and won’t know why you can’t get the page to stop appearing in your search.

Yoast used to be very helpful in this matter. They allowed you to deindex media attachments and it worked without incident. Recently, they have been pushing very hard to get WordPress site owners to upgrade to Yoast Premium and it’s been suggested that this is the reason why the deindexing option is not always available in your plugin settings as it used to be.

  1. How to check if your site has indexed media attachment files?

    [su_box title=”Use this simple search string in Google search:” color=”#3a80f1″]site:yoursite[dot]com + inurl:”attachment” on Google.com[/su_box]

    The solution: Once you have deindexed these nasty attachment media files you’ll need to head over to search console and with the list of URLs you discovered above you’ll need to submit them for deindexing. This is time-consuming and sadly there is currently no tool on the market to speed up the process. Hopefully, you have a loyal and trusted assistant as most technical SEOs do nowadays who will plug these in and request they be taken out of the search results.

    As this can potentially be a serious duplicate content issue if you have 100s or 1000s of media attachments on your site, it is imperative that you find a solution to the problem before it affects

    a)your crawl budget 

    b)your quality score

    Both of these will directly affect your keyword rankings in search.

    Having trouble making sense of this technical SEO issue? Help is just a call away. Schedule an appointment with me below or simply reach out on facebook and I’ll get you sorted in no time. As I like to say, hard problems are no problem when it comes to SEO.

Leave a Comment