09 Jul The Best Yoast SEO Bug Fix for Attachments in 5 Easy Steps
The YOAST bug became front page SEO news in June 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.
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 this
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:
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.
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…
- Sort the data by the column with the links in it.
- Find where the <link> node begins and highlight the whole row up to the last <link> node
- Copy and paste them into their own spreadsheet or tab
- use ‘text-to-columns’ functionality to separate the <link> node from the URL itself. You should have something that looks like this:
- Separate the domain from the slug so it looks like this:
Excellent, you’ve now extracted ALL the attachment URLs from WordPress and you’re ready to put them into Google Search Console.
Step 5: Copy and Paste each attachment URL into search console
Open Google Search Console and navigate to Google Index >> Remove URLs
Add the URL into the box and click Continue. You should see this screen:
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.
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.