Disable Media Pages
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: Search engine optimization 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. Reserved slugs 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. How it works 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. WP CLI support The plugin supports WP CLI. Mangle existing attachment slugs wp disable-media-pages mangle Restore attachment slugs wp disable-media-pages restore Note for WordPress 6.4 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. Thanks Special thanks to Greg Schoppe for his research and inspiration that helped a lot with developing this plugin. Support the 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: Disable Customizer Disable Drop Cap ACF Image Aspect Ratio Crop
Top keywords
- attachment15×3.49%
- pages13×3.02%
- attachment pages9×2.09%
- wordpress9×2.09%
- slugs7×1.63%
- disable6×1.40%
- page6×1.40%
- wp5×1.16%
- attachment slugs4×0.93%
- automatically3×0.70%
- because3×0.70%
- completely3×0.70%
Media Library Assistant
The Media Library Assistant provides several enhancements for managing the Media Library, including: Complete support for ALL taxonomies, including the standard Categories and Tags, your custom taxonomies and the Assistant’s pre-defined Att. Categories and Att. Tags. You can add taxonomy columns to the Media/Assistant listing, filter on any taxonomy, assign terms and list the attachments for a term. The Media/Assistant admin screen displays more attachment information such as parent information, file URL and image metadata. Provides many more listing columns (more than 20) to choose from. You can also add columns to display custom field values. Provides additional view filters for MIME types and taxonomies, and features to compose custom views of your own. Inline “Bulk Edit” and “Quick Edit” areas; update author, parent and custom fields, add, remove or replace taxonomy terms for several attachments at once. Works on the Media/Add New screen as well. Works with the popular Admin Columns plugin for even more Media/Assistant screen customization. IPTC, EXIF (including GPS), XMP and PDF metadata can be assigned to standard WordPress fields, taxonomy terms and custom fields. You can update all existing attachments from the Settings page IPTC/EXIF tab, groups of existing attachments with a Bulk Action or one existing attachment from the Edit Media/Edit Single Item screen. Twelve hooks provided for complete mapping customization from your theme or plugin code. You can view and/or download this PDF document with more information: Mapping File Metadata to WordPress Fields with Media Library Assistant Attachment metadata such as file size, image dimensions and where-used information can be assigned to WordPress custom fields. You can then use the custom fields in your [mla_gallery] display and you can add custom fields as sortable, searchable columns in the Media/Assistant submenu table. You can also modify the WordPress _wp_attachment_metadata contents to suit your needs. Complete control over Post MIME Types, File Upload extensions/MIME Types and file type icon images. Fifty four (54) additional upload types, 112 file type icon images and a searchable list of over 1,500 file extension/MIME type associations. Complete control over Intermediate Image Sizes, used by WordPress to generate and access intermediate image sizes for Media Library items. The [mla_gallery] shortcode, used in a post, page or custom post type to add a gallery of images and/or other Media Library items (such as PDF documents). MLA Gallery is a superset of the WordPress [gallery] shortcode; it is compatible with [gallery] and provides many enhancements. These include: 1) full query and display support for WordPress categories, tags, custom taxonomies and custom fields, 2) support for all post_mime_type values, not just images 3) media Library items need not be “attached” to the post, and 4) control over the styles, markup and content of each gallery using Style and Markup Templates. Twenty-eight hooks are provided for complete gallery customization from your theme or plugin code. The [mla_tag_cloud] shortcode, displays a “cloud” of the “most used” terms in your Media Library where the size of each term is determined by how many times that particular term has been assigned to Media Library items. Twenty-five hooks are provided for complete cloud customization from your theme or plugin code. The [mla_term_list] shortcode, displays hierarchical (and flat) taxonomy terms in list, dropdown control or checklist formats. Twenty hooks are provided for complete list customization from your theme or plugin code. The [mla_custom_list] shortcode, displays flat/cloud lists, dropdown controls and checkbox lists of custom field values. Twenty-seven hooks are provided for complete list customization from your theme or plugin code. The [mla_archive_list] shortcode, displays flat/cloud lists and dropdown controls of date-based values. Twenty hooks are provided for complete list customization from your theme or plugin code. Powerful Content Templates, which let you compose a value from multiple data sources, mix literal text with data values, test for empty values and choose among two or more alternatives or suppress output entirely. Support for WPML and Polylang multi-language CMS plugins. MLA has earned a place on WPML’s List of Recommended Plugins. Works with Photonic Gallery, Justified Image Grid, Jetpack and other plugins, so you can add slideshows, thumbnail strips and special effects to your [mla_gallery] galleries. Works with WordPress Real Media Library: Media Library Folder & File Manager (Lite and Pro) to organize your files into folders, collections and galleries. This combination enhances both the Media/Assistant admin submenu and the [mla_gallery] shortcode. Works with CatFolders – WP Media Folders (Lite and Pro) to categorize media files better and faster. This combination enhances both the Media/Assistant admin submenu and the [mla_gallery] shortcode. Enhanced Search Media box. Search can be extended to the name/slug, ALT text and caption fields. The connector between search terms can be “and” or “or”. Search by attachment ID or Parent ID is supported, and you can search on keywords in the taxonomy terms assigned to Media Library items. Works in the Media Manager Modal Window, too. Taxonomy and custom field support in the ATTACHMENT DETAILS pane of the Media Manager Modal Window and Media/Library Grid view. The Assistant is designed to work like the standard Media Library pages, so the learning curve is short and gentle. Contextual help is provided on every new screen to highlight new features. NOTE: Complete documentation is included in the Documentation tab on the Settings/Media Library Assistant admin screen and the drop-down “Help” content in the admin screens. You can find a stand-alone version of the Documentation on my web site: Media Library Assistant Documentation I do not solicit nor accept personal donations in support of the plugin. WordPress and its global community means a lot to me and I am happy to give something back. If you find the Media Library Assistant plugin useful and would like to support a great cause, consider a tax-deductible donation to our Chateau Seaview Fund at the ALS Network. Every dollar of the fund goes to make the lives of people with ALS, their families and caregivers easier. Thank you! Acknowledgements Media Library Assistant includes many images drawn (with permission) from the Crystal Project Icons, created by Everaldo Coelho, founder of Yellowicon. Many thanks to Aurovrata Venet, Il’ya Karastel and Kristian Adolfsson for testing and advising on the multilingual support features! The Example Plugins The MLA example plugins have been developed to illustrate practical applications that use the hooks MLA provides to enhance the admin-mode screens and front-end content produced by the MLA shortcodes. Most of the examples are drawn from topics in the MLA Support Forum. The Documentation/Example Plugins submenu lets you browse the list of MLA example plugins, install or update them in the Plugins/Installed Plugins area and see which examples you have already installed. To activate, deactivate or delete the plugins you must go to the Plugins/Installed Plugins admin submenu. The Example plugins submenu lists all of the MLA example plugins and identifies those already in the Installed Plugins area. In the submenu: the “Screen Options” dropdown area lets you choose which columns to display and how many items appear on each page the “Help” dropdown area gives you a brief explanation of the submenu content and functions the “Search Plugins” text box lets you filter the display to items containing one or more keywords or phrases bulk and rollover actions are provided to install or update example plugins the table can be sorted by any of the displayed columns Once you have installed an example plugin you can use the WordPress Plugins/Editor submenu to view the source code and (with extreme caution) make small changes to the code. Be very careful if you choose to modify the code! Making changes to active plugins is not recommended. If your changes cause a fatal error, the plugin will be automatically deactivated. It is much safer to download the file(s) or use FTP access to your site to modify the code offline in a more robust HTML/PHP editor. You can use the “Download” rollover action to download a plugin to your local system. Once you have made your modifications you can copy the plugin to a compressed file (ZIP archive) and then upload it to your server with the Plugins/Add New (Upload Plugin) admin submenu. If you do make changes to the example plugin code the best practice is to save the modified file(s) under a different name, so your changes won’t be lost in a future update. If you want to retain the file name, consider changing the version number, e.g. adding 100 to the MLA value, so you can more easily identify the plugins you have modified.