How to fix the Yoast SEO Bug for Attachments in 5 Easy Steps

Yoast Bug Fix


The YOAST bug became front page SEO news in 2018. But even if you haven’t heard about it, this post will still show you how to correctly manage attachments in WordPress for good. This is the tweet I got from the Yoast team after sharing my article…

So you can see, you need to do some due diligence over your attachment URLs whether you use Yoast or not. And if they end up in Google, well, remove them.

What was the Yoast Bug?

In short, the Yoast bug, meant every single image that have ever been uploaded to your website, now created a brand new page on your website. It created the possibility of THOUSANDS of new pages with literally ZERO content on them. To Google – that’s a thin content website.

Read more about the Yoast bug on Search Engine Journal here

The Symptoms?

Google dropped website rankings for many websites hit by the Yoast bug. One of our clients got hit too so we needed to act.

Yoast offered a solution. But, there were lots of complaints on the WordPress forum here…

What’s more, Yoast says it will take 6 months for all the URLs to be removed from Google. That’s waaaay too long for me.

I was a little sceptical.

So, I decided to find a different solution. One which was miles better for SEO. One which would take effect IMMEDIATELY.

This post tells you EXACTLY how I did it. I even offer to help if you need it, so keep reading.

I’ll warn you…

This is a fairly manual way of removing URLs from Google, so if you have 10,000 images, you may want to outsource part of this process.

Please share this with your followers because you never know who might have been hit with the Yoast bug.

How to find out if YOUR attachments are ruining your rankings

Firstly, check your Google Search Console, it might look something like thisSearch Console Yoast URLs

You can see, from the above image, that the index coverage massively increased at the end of May 18. Even if I was superman I wouldn’t be able to write that many posts in a day.

These ‘thin content’ pages need to be removed from the SERPS (Search Engine Results Pages) ASAP.

Let’s get to work…


How to find and remove all attachment URLs?

Step 1: Make sure your attachment URLs are redirected

This is essential and if you’ve read other articles about the Yoast bug, you’ll know already.

In WordPress, head over to:

Yoast >> Search Appearance >> Media

You need to make sure the below setting is set to YES:Yoast Attachments Settings

Step2: Download a plugin to extract URLs

The first thing to do is download this plugin and activate it:

Step 3: Extract the attachments

NOw that you’ve added the plugin, let’s use it. Here’s how

Select: Tools >> Attachment Export

Make sure attachments is selected and click:

An xml file will start downloading. Open this in a code editor.

Scroll down to the first <item> node and you will see your first attachment  URL nested within the <link> node.

Yoast XML URLs


Highlight the whole xml file and copy this into a brand new Excel file

Step 4: transform the XML file into a workable EXCEL spreadsheet.

This is quite advanced, so if you need a hand feel free to send me the XML file. My team will do it for you – matt @ ogguru . com. Here’s the broad level steps…

  1. Sort the data by the column with the links in it.
  2. Find where the <link> node begins and highlight the whole row up to the last <link> node
  3. Copy and paste them into their own spreadsheet or tab
  4. use ‘text-to-columns’ functionality to separate the <link> node from the URL itself. You should have something that looks like this:

Excel Attachment Yoast URLs

  1. Separate the domain from the slug so it looks like this:

Excel Attachment YOAST URLS 2

Excellent, you’ve now extracted ALL the attachment URLs from WordPress and you’re ready to put them into Google Search Console.
Here’s how…

Step 5: Copy and Paste each attachment URL into search console

Open Google Search Console and navigate to Google Index >> Remove URLs

Search Console Remove Links


Google Temporarily Hide



Add the URL into the box and click Continue. You should see this screen:

Google Remove URLs

Be sure to select ‘Temporarily hide page from search results and remove from cache’

Then Click Submit request.

Step 6: Repeat the remove link process with all the URLs listed in your Excel spreadsheet.

If you have hundreds or even thousands, why not put the work on fiver and get someone to do it for you. I promise it will be worth the benefit.

Please share this with your followers because you never know just who might have been hit by the YOAST bug.

The result

After checking in the new Google Search Console, this is what happened to organic impressions just after adding the first 25% of my client’s affected urls. As I write this, we are working towards getting 100% of urls added to the search console in this way.

Google impressions after bug fix

Share this article

Share on facebook
Share on twitter
Share on linkedin
Matt Adams
Matt Adams
Matt is Managing Director and founder of Online Growth Guru. He's been growing online businesses for over 15 years. He is a qualified Business Analyst and now shares his expertise with SME food and drink businesses to help them grow through the power of Digital Marketing.

This Post Has One Comment

  1. Francis

    great writeup! unfortunately I was not aware of yoast seo 7.0 bug and my organic traffic gradually dropped since march 2018. I fixed the issue by selecting yes in the settings and installed purge attachment url plugin from yoast. Wish i had done this 3 years ago when this bug affected my site! Now i have also requested google to remove the affected url’s. Hope my site recovers soon.

Leave a Reply