How to Easily Disable Image Attachment Pages in WordPress

How to Easily Disable Image Attachment Pages in WordPress

Do you want to know how to easily disable image attachment pages in WordPress?

Image attachment pages can hurt your SEO since Google and other search engines consider them “thin content”. They only show the image you’ve uploaded to your post or page, which isn’t useful for either users or search engines. 

So in this post, we’ll show you how to easily disable image attachment pages in WordPress and redirect them back to your images. We’ll also explain what an attachment page is and why you should disable it on your WordPress website. 

Feel free to click on these quick links to jump straight to different sections:

What Is a WordPress Attachment Page?

A WordPress attachment page is an automatically generated page that shows a single media file, such as an image, zip file, movie, or PDF document.

Whenever you upload an image or other media file when editing a post or page, the file is “attached” to that page. (On the other hand, if you upload a file directly to the Media Library, it’s not attached to any post or page.)

The automatically generated attachment page will display the media file and its title, metadata, and possibly also comments.

You can view attachment pages by clicking on Media in the WordPress dashboard menu. Click on the image, and scroll down to the View attachment page link and click on it to view the attachment page.

View attachment page in WordPress

Why You Should Disable Image Attachment Pages

You should disable image attachment pages in WordPress because they are of little value and can hurt your SEO. The only thing these pages do is to show a larger version of your image, and most WordPress websites don’t need them. 

They also include minimal text content, which search engines consider to be low quality or “thin content”. This will ultimately hurt your SEO rankings since user experience is Google’s top priority.

That’s why you should disable image attachment pages on your site, which we’ll show you how to easily do using the best SEO plugin for WordPress, All in One SEO (AIOSEO)

Easily Disable Image Attachment Pages in WordPress

The best WordPress SEO plugin, All in One SEO

Fortunately, you can easily disable your image attachment pages on your WordPress site with All in One SEO. 

AlOSEO is a complete SEO plugin that comes with many advanced and powerful SEO tools and features:

Alright, let’s dig in!

Manually Disable Attachment Pages

To get started, you first need to install and activate AIOSEO on your WordPress website. If you haven’t installed a plugin before, please visit WPBeginner’s guide on how to install a WordPress plugin.

Once you’ve activated AIOSEO, it automatically turns off attachment URLs. But you can also manually turn them off by visiting All in One SEO » Search Appearance and click on the Image SEO tab.

Search appearance and image SEO settings in All in One SEO

Then, make sure that the Redirect Attachment URLs option is set to Attachment.

Redirect attachment URLs back to attachment in All in One SEO

As simple as that!

Now your attachment pages will be redirected to the image itself. This means that whenever someone visits the URL for your attachment page, they’ll see the image instead. And this is also our default setting which we recommend using.

Redirect Image Attachment to Parent Post 

If you want to redirect an image attachment to your post in WordPress, you simply set the Redirect Attachment URLs setting to Attachment Parent

Redirect attachment image pages to post in All in One SEO

When using this setting, your attachment pages will be redirected to the post or page that the image is attached to. 

So whenever someone visits your attachment page, they’ll see the post or page where the image was uploaded to instead of the attachment page.

Note: If you’ve uploaded an image directly to the image library (not attached it to any post or page) and you’ve selected the last option, your website visitors will still see the attachment page. 

Show Attachment Pages in Search Results

If you still want your media attachment pages to appear in search results you can set this setting to Disabled instead.

Show attachment pages in search results setting in All in One SEO

That’s it!

We hope this blog post helped you learn how to disable image attachment pages in WordPress. Use these tips, and you’ll ensure that your image attachment pages won’t show up in search results. Best of all, Google won’t penalize you for creating “thin content”.  

Before you go, if you want to learn how to optimize your blog post like a pro, you should check out our blog post SEO checklist or SEO best practices

And if you want to increase your organic traffic at record speed, you should check out 30 SEO hacks guaranteed to grow your traffic.

Not using AIOSEO yet? What are you waiting for?

Want to Try AIOSEO for Free?

Enter the URL of your WordPress website to install AIOSEO Lite.

Please enable JavaScript in your browser to complete this form.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.

author avatar
Stina Pettersson

Reply Cancel Reply

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

4 comments on “How to Easily Disable Image Attachment Pages in WordPress

  1. When I go through this process, will it disable all existing attachment pages and redirect them back to the parent page of the appropriate blog post? Or do I need to update all existing images manually?