WordPress 6.4 Disables Attachment Pages for New Installations

The upcoming 6.4 release, expected on November 7, will disable attachment pages for new installations. Up until now, WordPress automatically created attachment pages when users upload a file through the media upload system. It has been treated as a special post type that holds information about the file and each attachment is accessible under its own URL. SEO plugins have been redirecting attachment pages for years, as they rarely have any significant purpose.

“Until WordPress 6.4 was released, WordPress created attachment pages by default for every attachment uploaded,” WordPress contributor Joost de Valk said in the dev note for this change. “On the vast majority of sites, these attachment pages don’t add any meaningful information. They do, however, exist, get indexed by search engines, and sometimes even rank in search results, leading to bad results for users and site owners.”

There will be no changes to existing sites. They will continue to work as they always have, but new sites will have their attachment pages redirected to the attachment URL. Site admins who want to enable or disable attachment pages can use the new  wp_attachment_pages_enabled database option to control attachment pages’ behavior.

There is no interface for changing whether a site disables attachment pages, which was somewhat controversial in the comments on the Trac ticket and the dev note.

“In light of the WordPress mantra ‘decisions, not options,’ we’ve decided against making a setting for this,” de Valk said.

WordPress plugin developer Sybre Waaijer mades a case for giving users an option with an interface for toggling it on or off:

The problem with filtering options is that when another plugin provides the option toggle, the option filter will go against user expectations.

This is where “decisions, not options” becomes paradoxical because we’re now deciding to set an option while also not giving the option.

So, as plugins fill in this gap, then A) where will plugins put the option (likely on their custom page instead of options-media.php), and B) of the dozens of types of plugins that are in the market to juggle this, who will ultimately be in control of the option?

If it’s a filter, each plugin promises to set a toggle via a simple condition. But since it’s an option, plugins can add an option to filter an option and add an option to toggle the option. It’ll become a source of bugs because of the logical biconditionals (XNOR).

While an interface isn’t in the cards for WordPress 6.4, and may never be back on the table for consideration, contributors are discussing the possibility of putting this in a core plugin.

“Should we not have a core plugin for re-enabling attachment pages on new sites?” Automattic-sponsored contributor Justin Tadlock said. “If there’s not going to be a UI for this, then a plugin that’s not buried in a Trac ticket would be ideal.”

de Valk agreed this would be a good idea to have a plugin that simply adds a setting to the Options -> Media page. Users likely will not understand the purpose of attachment pages unless they are looking to enable them for a specific, niche use case. A plugin like this would be useful for those who are not able to write the code to change attachment pages’ behavior, as described in the dev note.

6

6 responses to “WordPress 6.4 Disables Attachment Pages for New Installations”

  1. End user here, limited knowledge.

    Where will the information that was on the attachment page be held if no such page is created? How, if at all, will it affect my working with images and PDF files in my Media Library?

    Thanks!

  2. Wouldn’t it have made sense to make this controllable via a constant in wp-config.php, the same way enabling the links manager is handled now? I’m curious why two different disabled core features that still exist in core are now enabled via two separate methods: constant or database option.

  3. I think that is a bad solution, or no solution at all.

    After this change…

    The attachment still will be created as new entries in the posts and postmeta tables in the WordPress database
    From now, the user hasn’t any setting to decide to use or not to use the attachments URLs, it’s needed to modify the option in the DB or in the admin options.php hidden page

    In regard to performance is a mistake. The problem remains, and hidden to the user.

    So, for the end user was a better approach to use SEO plugins settings, where it can be decided how the attachment pages are to be showed, or not.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Discover more from WP Tavern

Subscribe now to keep reading and get access to the full archive.

Continue reading