In our major Yoast SEO 7.0 update, there was a bug concerning attachment URLs. We quickly resolved the bug, but some people have suffered anyhow (because they updated before our patch). This post serves both as a warning and an apology. We want to ask all of you to check whether your settings for the redirect of the attachment URLs are correct. And, for those of you who suffered from a decrease in rankings because of incorrect settings, we offer a solution that Google has OKed as well.
Is redirect attachment URLs set to “Yes”?
You need to check this manually: unless you have a very specific reason to allow attachment URLs to exist (more on that below), the setting should be set to “Yes” . If the setting says “Yes”, you’re all set. You can find this setting in Search Appearance, in the tab Media.
Is your attachment URL set to “No”?
If your attachment URL is set to “no”, there are two different scenarios which could apply to you. You could intentionally have set this setting to “no”, but the setting could also be turned to “no” without your intent.
Intentionally set to “No”
If you intentionally put the setting of the attachment URL to “No”, you’ll probably be aware of that fact. In that case, your attachment URLs are an important aspect of your site. You’re linking actively to these pages and these pages have real content on them (more than just a photo). This could for instance apply to a photography site. If you want this setting to say “No”, you’ll probably have put a lot of thought in this. In this case, you can leave your setting to “no”. You’re all set!
Unintentionally set to “No”
It is also possible that you notice that the setting is set to “No” and this was not intentionally. You’ve suffered from our bug. We’re so very sorry. You should switch your toggle to “Yes” and save the changes. Perhaps you need to do a little bit more, though. There are (again) two scenarios:
Traffic and ranking is normal
Ask yourself the following question: have you noticed any dramatic differences in your rankings and traffic in the last three months (since our 7.0 update of march 6th)? If the answer to this question is no, than you should just turn the redirect setting of the attachment URL to “Yes” and leave it at that. You did not suffer from any harm in rankings, probably because you’re not using attachment URLs all that much anyway. This will be the case for most sites. After switching your toggle to “Yes” and saving the changes, you’re good to go!
Traffic and ranking have decreased
In the second scenario, you notice that the redirect attachment URL setting is set to “No” and you did indeed suffer from a dramatic decrease in traffic and ranking. We’re so very sorry about that. Make sure to switch the setting of the attachment URL to “Yes” immediately. In order to help you solve your ranking problem, we have built a search index purge plugin. Download and install this plugin here. More on the working of this separate plugin below.
What to do if you’re not sure
If you’re not sure whether you’ve been affected by this, and your Google Search Console is inconclusive: don’t do anything other than setting the setting to “Yes”. See “What did Google say” below for the rationale.
What do attachment URLs do anyway?
When you upload an image in WordPress, WordPress does not only store the image, it also creates a separate so-called attachment URL for every image. These attachment URLs are very “thin”: they have little to no content outside of the image. Because of that fact, they’re bad for SEO: they inflate the number of pages on your site while not increasing the amount of quality content. This is something that WordPress does, which our plugin takes care off (if the setting is correctly turned to “Yes”).
Historically, we had had a (default off) setting that would redirect the attachment URL for an image to the post the image was attached to. So if I uploaded an image to this post, the attachment URL for that image would redirect to this post. In the old way of dealing with this, it meant that images added for other reasons (like say, a site icon, or a page header you’d add in the WordPress customizer), would not redirect. It also meant that if you used an image twice, you could not be certain where it would redirect.
In Yoast SEO 7.0 we introduced a new feature to deal with these pages. Now, we default to redirecting the attachment URL to the image itself. This basically means attachment URLs no longer exist on your site at all. This actually is a significant improvement.
What did the bug do (wrong)?
The bug was simple yet very painful: when you updated from an earlier version of Yoast SEO to Yoast SEO 7.0-7.0.2 (specifically those versions), we would not always correctly convert the setting you had for the old setting into the new one. We accidentally set the setting to ‘no’. Because we overwrote the old settings during the update, we could not revert this bug later on.
The impact of the bug
For some sites our bug might have a truly bad impact. In Twitter and Facebook discussions I’ve had, I’ve been shown sites that had the number of indexed URLs on their site quintupled, without adding any content. Because with that setting being “No” XML sitemaps was enabled for attachments. As a result of that, lots and lots of attachment URLs got into Google’s index. Some of those sites are now suffering from Panda-like problems. The problem will be specifically big if you have a lot of pictures on your website and few high quality content-pages. In these cases, Google will think you’ve created a lot of ‘thin content’ pages all of a sudden.
The vast majority of the websites running Yoast SEO probably hasn’t suffered at all. Still, we messed up. I myself, am sorry. More so than normal, because I came up with and coded this change myself…
What did Google say?
We have good contacts at Google and talk to them regularly about issues like these. In this case, we discussed it with John Mueller and his first assessment was similar to mine: sites should normally not suffer from this. That’s why we don’t think drastic measures are needed for everyone. Let me quote him:
“Sites generally shouldn’t be negatively affected by something like this. We often index pages like that for normal sites, and they usually don’t show up in search. If they do show up for normal queries, usually that’s a sign that the site has other, bigger problems. Also, over the time you mentioned, there have been various reports on twitter & co about changes in rankings, so if sites are seeing changes, I’d imagine it’s more due to normal search changes than anything like this.”
We’ve also discussed potential solutions with him. The following solution has been OK’d by him as the best and fastest solution.
What does this search index purge plugin do?
The purpose of the search index purge plugin is to purge attachment URLs out of the search results as fast as possible. Just setting the Yoast SEO attachment URL redirect setting to “Yes” isn’t fast enough. When you do that, you no longer have XML sitemaps or anything else that would make Google crawl those pages, and thus it could take months for Google to remove those URLs. That’s why I needed to be creative.
Installing this plugin will do the following two things:
- Every attachment URL will return a 410 status code.
- A static XML sitemap, containing all the attachment URLs on a given site will be created. The post modified date for each of those URLs is the activation date and time of the plugin.
The XML sitemap with recent post modified date will make sure that Google spiders all those URLs again. The 410 status code will make sure Google takes them out of its search results in the fastest way possible.
After six months the attachment URLs should be gone from the search results. You should then remove the search index purge plugin, and keep the redirect setting of the attachment URLs set to “Yes”.
Advice: keep informed!
We try to do the very best we can to help you get the best SEO out of your site. We regularly update our configuration wizard and there is no harm whatsoever in running through it again. Please regularly check if your site’s settings are still current for your site. We do make mistakes, and this release in particular has led us to a rigorous post mortem on all the stages of this release’s process.
We regularly write about things that change in Google, so stay up to date by subscribing to our newsletter below. If you want to understand more of the how and why of all this, please do also take our new, free, SEO for Beginners course, which you’ll get access to when you sign up.