How to Disable Image Attachment Pages in WordPress

July 8, 2013

In this article, I’m going to show you a simple way to disable Image attachment pages in WordPress. It’s quite easy to do however, we can’t disable image attachment pages but can redirect them to the parent post URLs. The WordPress SEO by Yoast is the best SEO plugin for redirecting the image attachment pages to the parent posts. Let me just show you the settings that needed to be configured in order to redirect image attachment pages to parent posts.

Disabling Image Attachment Pages using WordPress SEO by Yoast Plugin

Follow the steps below:

1. Go to SEO tab > Permalinks
2. Check box to redirect attachment URL’s to parent post URL

That’s it.

You can also redirect attachment pages by using a completely separate plugin.

Attachment Pages Redirect

Attachment Pages Redirect makes attachment pages redirects (301 permanent redirect) to post parent if any. If not, redirects (302 temporal redirect) to home page.

Muhammad Dilawar
Muhammad Dilawar
Muhammad Dilawar is a WordPress developer and technical SEO specialist with over 12 years of experience building, optimizing, and maintaining websites. He specializes in WordPress, WooCommerce, server optimization, DNS, Cloudflare, website security, and performance improvements. Through Softstribe, he shares practical guides, tutorials, and industry insights based on real-world experience helping businesses grow their online presence.
More from Muhammad Dilawar