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?
- Why You Should Disable Image Attachment Pages
- Easily Disable Image Attachment Pages in WordPress
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.
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
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:
- Smart XML Sitemaps — automatically generate a WordPress XML sitemap to notify all search engines of any new updates.
- Unlimited SEO Keyphrases — optimize your content on unlimited keyphrases and add related keywords in a single click.
- Rich Snippets Schema — add schema markup to your pages and get more clicks and traffic with Google rich snippets.
- Local SEO — boost rankings for all your Business listings, and get featured in Google’s Knowledge Panel and Google Maps.
- Redirection Manager — get access to easy and quick management of your 301 redirects and 404 errors.
- …and more.
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.
Then, make sure that the Redirect Attachment URLs option is set to Attachment.
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.
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.
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?
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.
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?
Hi Jill,
It will do it automatically; no need to do anything manually.
Thanks.
it didn’t work.
attachment media is still showing URL
Hi there! Thank you for your comment. Would you kindly reach out to our support team with your issue?
Thank you.