Stop Indexing WordPress Attachment Pages
Have you every actually checked how your website appears in SERPs? You might want to, especially if you are running WordPress. The reason is that when you upload an image and insert the normal way it creates a separate WordPress attachment page. And if you aren’t careful Google might actually start indexing these pages. You can see below in this picture that is what happened to me.
You can see above that “raventools” and “google-authorship” are actually the names of two image attachment pages. Example, here is what the raventools link goes to: https://brianjackson.io/adding-keywords-to-raven-tools-ranking-in-bulk/raven-tools.
You can see that page is simply the attachment page that is created due to the image upload. Why is this a bad thing? It’s bad because in SERPs you have things showing up that are named wrong. Also, visitors are now hitting pages that are completely blank which may in turn lead to a higher bounce rate.
Option 1 (preferred method)
The easiest way to fix this is to redirect the WordPress attachment pages to the original page/post. In this example I will show you how to do this using the Yoast SEO plugin. (there is also a similar setting in the All in One SEO plugin)
In WordPress click into SEO and then click on “Advanced”
Click into the “Permalinks” tab.
Then select the box “Redirect attachment URL’s to parent post URL.”
Then click “Save Changes.”
So now my raventools attachment page here: https://brianjackson.io/adding-keywords-to-raven-tools-ranking-in-bulk/raven-tools is redirected to the post that the image is on: https://brianjackson.io/adding-keywords-to-raven-tools-ranking-in-bulk/
Another way to prevent this from happening is to click into the image attachment page and mark it as no-index within the Yoast plugin.
A third way to prevent this as Olaf mentioned below in the comments is that you could block all of your attachment pages from indexing within your robots.txt file. I prefer option 1 as it is quick and easy.
If you don’t want to install or use Yoast, there is also a standalone WordPress plugin called Noindex Attachment Pages.
As always feel free to leave your comments below! Make sure to subscribe to my newsletter for more great SEO and WordPress tips.
GET MORE STUFF LIKE THIS
Marketing, WordPress, Blogging Tips, SEO and Reviews, once a week.
Thank you for subscribing.
Something went wrong.