WordPress 6.4 Disables Attachment Pages for New Installations – WP Tavern
The upcoming 6.4 launch, anticipated on November 7, will disable attachment pages for new installations. Up till now, WordPress mechanically created attachment pages when customers add a file by way of the media add system. It has been handled as a particular put up sort that holds details about the file and every attachment is accessible underneath its personal URL. web optimization plugins have been redirecting attachment pages for years, as they hardly ever have any vital function.
“Till WordPress 6.4 was launched, WordPress created attachment pages by default for each attachment uploaded,” WordPress contributor Joost de Valk mentioned within the dev note for this change. “On the overwhelming majority of websites, these attachment pages don’t add any significant info. They do, nevertheless, exist, get listed by engines like google, and typically even rank in search outcomes, resulting in unhealthy outcomes for customers and website homeowners.”
There might be no adjustments to present websites. They’ll proceed to work as they all the time have, however new websites may have their attachment pages redirected to the attachment URL. Web site admins who need to allow or disable attachment pages can use the brand new wp_attachment_pages_enabled
database possibility to manage attachment pages’ habits.
There isn’t any interface for altering whether or not a website disables attachment pages, which was considerably controversial within the feedback on the Trac ticket and the dev be aware.
“In mild of the WordPress mantra ‘selections, not choices,’ we’ve determined towards making a setting for this,” de Valk mentioned.
WordPress plugin developer Sybre Waaijer mades a case for giving users an option with an interface for toggling it on or off:
The issue with filtering choices is that when one other plugin supplies the choice toggle, the choice filter will go towards consumer expectations.
That is the place “selections, not choices” turns into paradoxical as a result of we’re now deciding to set an possibility whereas additionally not giving the choice.
So, as plugins fill on this hole, then A) the place will plugins put the choice (possible on their customized web page as a substitute of options-media.php), and B) of the handfuls of forms of plugins which might be available in the market to juggle this, who will finally be in charge of the choice?
If it’s a filter, every plugin guarantees to set a toggle by way of a easy situation. However because it’s an possibility, plugins can add an choice to filter an possibility and add an choice to toggle the choice. It’ll turn into a supply of bugs due to the logical biconditionals (XNOR).
Whereas an interface isn’t within the playing cards for WordPress 6.4, and should by no means be again on the desk for consideration, contributors are discussing the potential for placing this in a core plugin.
“Ought to we not have a core plugin for re-enabling attachment pages on new websites?” Automattic-sponsored contributor Justin Tadlock mentioned. “If there’s not going to be a UI for this, then a plugin that’s not buried in a Trac ticket could be preferrred.”
de Valk agreed this could be a good suggestion to have a plugin that merely provides a setting to the Choices -> Media web page. Customers possible is not going to perceive the aim of attachment pages until they need to allow them for a selected, area of interest use case. A plugin like this could be helpful for individuals who usually are not capable of write the code to alter attachment pages’ habits, as described within the dev note.