Yoast Bug Fix 2018 the best solution

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


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

  • Matt Adams
    Shawn Limbach
    Posted at 22:40h, 17 July Reply

    Hi Matt, Did you turn off the Yoast Index Surge Plug-in before, during or after this process?

    • Matt Adams
      Matt Adams
      Posted at 11:59h, 18 July Reply

      Hey Shawn, I didn’t actually activate the Purge Index plugin at all. So I guess the answer is ‘before’ this process. Hope that helps 🙂

  • Matt Adams
    Shawn Limbach
    Posted at 01:58h, 25 July Reply

    Thank you! Appreciate the solution.

    • Matt Adams
      Matt Adams
      Posted at 09:21h, 30 July Reply

      No problem 🙂

  • Matt Adams
    Posted at 06:43h, 10 August Reply

    Hi. I’ve done all this and my rankings went back up quite quickly – then tanked! I don’t know why? Any ideas? My traffic isn’t huge, but it’s less than half what it was and earnings are now almost zilch. Frustrating!

  • Matt Adams
    Posted at 11:57h, 04 September Reply

    Thanks for the awesome guide Matt!

    My traffic has dropped off hugely, and I think this might have saved me.

    • Matt Adams
      Matt Adams
      Posted at 12:29h, 04 September Reply

      No problem Wes. Hope it helps 🙂


  • Matt Adams
    Posted at 14:39h, 06 September Reply

    Thanks for the great tutorial Matt.

    I have struggled to reduce my index count for a while so hopefully with your help I get it right!

    Keep up the great work!

    • Matt Adams
      Matt Adams
      Posted at 14:52h, 06 September Reply

      No Problem Hansie, hopefully it helps 🙂

  • Matt Adams
    Natalia Swiader
    Posted at 20:34h, 19 October Reply

    Due to the Yoast Bug I got 1494 404 errors according to the Search Console. I decided to manually remove URLs (using ‘Temporarily hide from search results and remove from cache) in Google Search Console but I didn’t uninstall the Purge Plugin. My rankings improved but only a little bit 🙁 Should I now remove the Purge plugin or should I keep it activated?


Post A Comment