
Completely disable “attachment” pages created by WordPress.
By default, WordPress creates a page for each of your attachments. This is can be undesirable because of two reasons:
Attachment pages don’t have any content, except an image, so they provide little value and can negatively affect your SEO because they are so-called thin content. Even worse, attachment pages may in some cases rank higher than your actual content pages which leads to a poor user experience.
Attachment pages can accidentally reserve slugs on your site. Let’s say you upload an image named contact.jpeg, an attachment page https://example.com/contact is automatically created. If you then try to create a page named Contact, the URL for that page will be https://example.com/contact-2 which isn’t that great.
This plugin works by automatically setting all attachment slugs to an unique id, so they won’t conflict with your pages. If an attachment page is accessed, the plugin will set a 404 status code and display the “page not found” template.
You can also mangle any existing attachment slugs so they won’t cause any issues in the future.
The plugin supports WP CLI.
wp disable-media-pages mangle
wp disable-media-pages restore
WordPress 6.4 includes a new feature that allows you to disable attachment pages. However, this feature redirects attachment pages to the file URL instead of returning a 404 error. To completely disable attachment pages, you should use this plugin instead. The WP 6.4 feature also does not fix the issue where attachment pages reserve slugs for pages.
Also, there is not user interface to enable or disable media pages, they are automatically disabled for new sites but remain enabled for existing sites.
Because of these issues, I recommend you to use this plugin instead of the built-in feature. The plugin will be updated in the foreseeable future, at least until attachment pages are completely removed from WordPress core and older WordPress versions are no longer in use.
Special thanks to Greg Schoppe for his research and inspiration that helped a lot with developing this plugin.
Maintaining a WordPress plugin is a lot of work. If you like the plugin, please consider rating it on WordPress.org. You can also support me on GitHub sponsors. Thank you!
If you are interested, you can also check out my other WordPress plugins:
Starting from $0 per month.
Rating
Reviewers
13 reviews
Tags
Developed By
joppuyo
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Contact Form plugins for Wordpress
Forms plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Comments plugins for Wordpress
Portfolio plugins for Wordpress
Maps plugins for Wordpress
Security plugins for Wordpress
Translation plugins for Wordpress
Ads plugins for Wordpress
Video Player plugins for Wordpress
Music Player plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Chat plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Tabs plugins for Wordpress
Membership plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Inventory plugins for Wordpress
Video Player plugins for Wordpress
Testimonials plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Social Feeds plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Events Calendar plugins for Wordpress
Contact plugins for Wordpress
Comments plugins for Wordpress
Analytics plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Show Airbnb reviews to build trust, improve credibility, and help visitors make confident booking decisions that support higher property sales.

Show Mastodon posts in a live Mastodon feed that keeps content fresh, strengthens your social presence, and helps visitors engage with your updates.
Add a unified chat tool to your site that connects users via WhatsApp, Messenger, Telegram, or email for seamless support.
Show social proof that displays real user activity to build trust instantly, boost credibility, and help increase conversions across your site.
Show alerts and updates with a notification popup that grabs attention, delivers important messages, and improves user experience.
Use a pricing slider to show dynamic prices by quantity, help visitors compare options, and support confident purchases.
Display clean code snippets with syntax highlighting to improve technical content and help developers scan examples quickly.
Add a no-code audio player to your site and boost engagement with music, podcasts, and voice content effortlessly.
Show Capterra reviews to build trust, strengthen credibility, and help visitors make confident software buying decisions that support higher sales.
Show Threads posts in a live feed that keeps content fresh, builds social proof, and helps visitors engage on your site.
Nudge button with a subtle shaking animation that draws attention to important calls to action, increases interaction, and helps boost conversions.
Create business listings with a listings widget that presents companies clearly, supports easy organization, and helps visitors find the right services quickly.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
