How Indexing WordPress Attachment Pages Can Hurt Your SEO

How Indexing WordPress Attachment Pages Can Hurt Your SEO

Not too long ago, you may have started noticing a lot of pages in Google search results that don’t really look like they should be there. These results lead to a blog post, but the “post” is actually just an image with the associated alt text. It has all of the top and sidebar trappings of a normal blog post, but it’s not a post itself.

These pages are showing up in search because of an update to the Yoast SEO plugin that, perhaps accidentally, enabled those pages to be indexed. If you’ve seen them in the past, it’s likely because of another plugin, or lack thereof, making them visible.

These pages exist on WordPress by default, but they aren’t meant to really be visible to the web at large. The setting exists in case you want to go all-in optimizing your image pages, writing long mini-posts about each image you create. This is something basically no one does, though.

These pages can actually have a large impact on your SEO. I can attest to this personally; that Yoast update caused the pages to suddenly become visible across my sites, leading to a lot of pages indexed with very little content on them. It took a while to fix the issue, and longer for Google to index the changes, and in the mean time my traffic dropped quite a bit.

Why Is This a Problem?

It’s undeniable that this is a problem – I can show you analytics results to prove it – but why? Well, the answer goes all the way back to 2011 and the Google Panda update.

Panda was a huge Google algorithm change that prioritized high quality content and devalued low quality content. This was a move to combat content farms specifically, as well as content scrapers and thin content blogs. It helped remove private blog networks from circulate, got rid of a lot of spam blogs with spun content, and hurt sites like eHow that relied on millions of low value articles to survive. eHow and other sites like it have adapted to survive, but many have not.

The effects of Panda are still felt today, with content penalties for thin pages and for duplicate content. The problem, then, is that these image pages become thin content.

Imagine if every image you’ve ever posted in a blog post suddenly became a link to another “post” on your site, with nothing but the image and a sentence or two of content. If you have 3 images in every blog post, that’s a huge amount of new pages created virtually overnight. Suddenly, 75% of your website is thin content.

That alone makes Google hammer the content penalty. And, to be clear, this isn’t a manual penalty. It’s just how the Google algorithm ranks a site. When the proportion of bad content to good content grows too high, your site is devalued. In extreme cases, you can be deindexed entirely.

The fact that deindexation didn’t happen to me is entirely due to the quality of my site prior to the explosion of thin content. In fact, many of those thin pages ranked highly for their associated keywords, simply due to the weight of the rest of my site. My problem was not with a lowered search ranking, but rather with dilution of the search results.

Diluted search results is what happens when suddenly I have 300% more content on my site for all the same keywords. Many of those “new” pieces of content rank for the same keywords as the articles the images come from. That means the content is fighting against itself for search ranking positions. Sometimes the article wins, sometimes the image wins, and it all jumps around as Google figures out what to do with it.

Of course, this means the traffic coming to my site is diluted between those links, and in most cases, the individual image pages lose the traffic to bounces. A user clicks expecting an article, sees an image, and leaves rather than trying to find the actual article. Before I fixed the issue, I had a huge bounce rate for this exact reason.

I have no doubt that my site would have eventually tanked out of the search results entirely if I did not diagnose and fix the issue. The fact that this happened suddenly all at once, and that my site was in good standing before it happened, allowed Google to give me the benefit of the doubt. Essentially, Google said “hey, this is a problem, but we’re not going to dramatically punish you for it because it might have been an accident. Fix it and you’ll be back to normal, but if you don’t fix it, you’ll tank.”

Of course, they didn’t spell that out for me. Google doesn’t send out emails with warnings to you. If you’re not up on keeping track of your website, you might not know this had happened.

There are, thankfully, several different ways you can fix the problem.

Method 1: Changing Image Settings

WordPress by default has different settings for how image posts are handled in the system. Creating an image post is one such setting, but you can also set WordPress to display the image in a lightbox when it’s clicked, or bring the user to the image directly.

Link to Attachment Page

You can change this setting for your images at any time, to change the destination of the link. You can even have it link to an external page. For example, if I was sourcing a screenshot from another website, I could have the image link directly to the article the screenshot comes from.

The problem with this as a fix for the problem is that there’s no way to do it en masse. If you have a six-year-old blog with thousands of images in your content library, and all of them are set to link to an image post page, you’re screwed.  You can go through and change them, but you have to do it one at a time, manually.

This isn’t really a method to fix the problem, then, so much as it is awareness of the issue. Moving forward, you can choose to change that setting when you upload new media to your library and insert it into a post.

Method 2: Manual Code Editing

The problem is described here as well, along with some manual code you can use to fix it. There are two variations here.

Variation one is to just change the setting manually. You will want to go to your WP Admin settings and options page. Type in your to go directly to the options menu. One such option will be labeled image_default_link_type. You can change the box there to whichever option you want, ideally “None” to nuke the whole issue.

Default LInk Type

Unfortunately, if you use any SEO plugins or a theme that sets SEO options itself, this setting probably won’t let you save. It will be overwritten by whatever control causes the change. The page I linked to above has a solution that I’m not going to just copy and paste here.

The solution, at least for the issue where a theme is setting the option itself, is to add code to the theme to change it. The code is pasted there, and you can add it to the functions.php file in the appropriate place as described in the instructions. I’d be a little more precise, but those instructions will vary depending on the theme and architecture you’re using.

Method 3: Fixing the Settings

You would think this is the first thing you would try, but honestly, I don’t consider it a good enough solution anymore.

If you use Yoast and were hit by the same problem I was, you can go into the Yoast settings, enable advanced settings if you haven’t already, and find the media post attachment settings. Simply turn off indexation for media posts again. This will deindex all of those pages, restoring your site to the way it was before the issue cropped up.

Media in Search Results

My problem with this solution is that, well, I already had those settings disabled. Yoast pushed an update that changed my setting and hurt my site. I can disable indexation again, but what happens the next time the issue occurs? I don’t want to keep having to deal with the fallout of a plugin update hurting my site, over and over.

Obviously, there’s no guarantee that this will ever happen again. It’s just not a risk I want to take, and it’s a problem I can solve in more permanent, potentially more SEO-friendly ways.

Method 4: Redirection

The method I have chosen to solve the problem, and the method I find most useful to recommend, is a redirection plugin.

Yoast has a setting to enable this redirection, but again, I’ve lost some trust in Yoast because of this. That’s why I’ve chosen to use a different plugin to do the same thing. It’s a simple, add-and-forget plugin that doesn’t increase my page load times, so I’m fine with adding it. It won’t hurt my SEO, after all.

What this plugin does is simple. It implements a redirect from the attachment page to the post that hosts the attachment. It has a few contingencies if there’s an issue with that post, as well.

Attachment Pages Redirect

The first possibility is that a user lands on the attachment post instead of the article that hosts the attachment, but that article exists and works fine. In that case, the plugin will implement an SEO-friendly 301 redirect and send the user to the post that the image is in. This is the intended behavior, after all.

The second possibility is that the user lands on the attachment post instead of the article, but the article is scrapped – in the WordPress Trash folder, but not permanently deleted. In some versions of WordPress, this would cause a redirect loop and stick the user in an infinite loading screen. To prevent that, this plugin detects the issue and lands on your 404 page. If you have a custom 404 page, all of that works fine.

The third possibility is that the user lands on the attachment post instead of the article, but the article is gone. It has been deleted permanently. In this case, the plugin implements a 302 temporary redirect to your homepage. You can detect this by monitoring your site analytics and checking the sources of your traffic. When you find such an issue, you can either replace the article with something new, or remove the attachment so that page disappears. I recommend the former, since after all, if people are landing on it, there must be some value to the content.

If you deleted the content with good reason and want it permanently gone, but for some reason don’t want to delete the media attachment page itself, you can change the plugin to implement a 301 permanent redirect there instead. This will send the traffic to your homepage directly. I don’t recommend this, because the user might be looking for the image itself, and won’t find it on your homepage. I’d prefer deleting the attachment page when I find such an instance.

In any case, the plugin is free, simple to install, and only has that one configuration option. It’s an ideal solution to help prevent the issue from occurring again, and minimize the damage if it does.

I’m a little disappointed that a bug in Yoast’s update caused all of these issues, and if it was any less useful plugin, I would drop it without hesitation. The value of all of the other Yoast settings is such that removing it would be far too much work, unfortunately, so I’ve had to make do. Hopefully, you’ll be in a better situation.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Link Exchange vs. Guest Posting: Which Strategy Yields Better SEO Results?

Sep 07, 2023 by Girish Benvanshi

In the ever-evolving landscape of digital marketing, search engine opt...

Harnessing the Power of Customer Reviews To Boost Your SEO Strategy

Sep 06, 2023 by Charlie Fletcher

If you asked a group of successful business owners about their marketi...

Artificial Intelligence (AI) in Marketing: Enhancing Customer Experiences

Sep 05, 2023 by Pramod Srivastava

Artificial Intelligence (AI) has emerged as a transformative technolog...