Disable Media Pages


Disable “attachment” pages for WordPress media.

By default WordPress creates a page for each of your attachments. This is can be undesirable because:

  1. These are pages that don’t have any content, except an image, so they provide little value and can negatively affect your SEO.
  2. They can accidentally reserve slugs on your site. Let’s say you upload an image named contact.jpeg, a page like 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.

How it works

This plugin works by automatically setting all attachment slugs to an unique id, so they won’t conflict with your pages. The plugin will also set 404 status code if a media page is accessed.

You can also mangle any existing attachment slugs so they won’t cause any issues in the future.


  1. Install the plugin from your WordPress dashboard
  2. Activate the Disable Media Pages plugin via the plugins admin page
  3. From now on, media pages will be disabled and new media items uploaded in the library will get unique id slugs


How to mangle existing attachment slugs?

Go to the plugins page, scroll to “Disable Media Pages”, click “Settings”. This will show you a wizard to mangle existing attachment slugs.

Why not just use Yoast SEO? It has a feature to redirect attachment pages to parent

First of all, not everyone uses Yoast SEO. More importantly, while Yoast SEO can fix the duplicate content issue, it does not help with issue of media files reserving slugs for pages.


February 18, 2021
Media attachments URL are a real problem in WordPress. Some developers of plugins have decided to redirect ALL media attachments to the homepage. They are wrong. One of my websites has been already penalized for such a behavior. Some developers of plugins decide to redirect media attachments to the parent page. They are wrong too. If you upload a picture to WordPress, and then if you go to the media library and click on view attachment page, you will be able to see the attachment page because it has no parent. It is normal since you didn't added the picture to a post or a page. When the picture isn't listed on a post or page, it still has an attachment page. So, some of you may say: "but I think that google will never find it". You are wrong! In fact, because of autocomplete function of wordpress and other auto guessing features of plugins, Google may follow a Url and end up on the attachment page. This plugin destroys media attachment by returning a 404. That's the best. Using this technique, it ensures that you will never get penalized because of the media attachment. The 404 is the best approach. I looked into the redirections when googlebot visited a Attachment URL using Yoast. GOoglebot expects a HTML page at the end of the redirection. However, Yoast redirects to an image. Let me explain. I saw that after hitting the attachment page and being redirected to the URK (for instance: /jojo.jpg). Google sends a HTTP request: "accept: text/html" in other words, google thinks that jojo.jpg is a HTML file. It is normal because the source is a HTML page (the attachment page). Googlebot does not like this redirection between it transits from a HTML page to a media file (for instance an image). Then, Googlebot is lost and will come back several time, looking for a text/html rather than a image/jpeg PLus, this plugin is super easy to use. You install it, activate it and it works out of the box.
Read all 3 reviews

Contributors & Developers

“Disable Media Pages” is open source software. The following people have contributed to this plugin.


“Disable Media Pages” has been translated into 6 locales. Thank you to the translators for their contributions.

Translate “Disable Media Pages” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.


1.0.4 (2021-01-02)

  • Change: Add icon

1.0.3 (2020-12-31)

  • Fix: Change required WordPress version correctly to 5.0
  • Fix: Optimize autoloader

1.0.2 (2020-12-31)

  • Change: Release on WordPress plugin directory
  • Change: Changes to internal plugin structure
  • Fix: Make plugin translatable
  • Fix: Load JavaScript and CSS only on plugin page

1.0.1 (2020-12-19)

  • Fix: WordPress 5.6 compatibility, thanks @tnottu

1.0.0 (2020-09-26)

  • Initial release