You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
support attachment pages is disabled by default since 6.4, so why then offer image be viewed in attachment pages? #78100
I've been playing around in the block editor.
in the image/gallery block toolbar a hyperlink can be added (see link icon)to the image/gallery. Option 'link to attachment page' doesnt work as expected. It just opens the media file directly instead of using the attachment template. This is caused by the settings option wp_attachment_pages_enabled that has been set to 0 since WP 6.4. This causes function redirect_canonical(...) to redirect to the attachment source instead of returning the attachment template.
My question is, why is the usage of attachment pages disabled by default when in different pages the option to use attachment pages is still offered? There is also no notice given (in the image/gallery toolbar) that the option might not work due to the disabling of wp_attachment_pages_enabled.
Another place in the backend were this is an issue is the media edit page. The media permalink clearly points to the attachment page. But when clicked the media file is directly opened.
My suggestion is:
either turn back on the support of the usage of attachment pages
add an option to the Settings page with which the admin can enable/disable support for use of attachment pages
disable the option 'link to attachment page' in the image/gallery block toolbar
Step-by-step reproduction instructions
Create a new page/post, or simply edit existing ones
Try adding image block or gallery block
Once added, try linking them. We will find an option to link it to attachment pages even if they are disabled. If these URLs are accessed, they redirects to attachment file URL.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Please confirm which theme type you used for testing.
Activity
Mamaduka commentedon May 8, 2026
This is a duplicate of #56019 and requires https://core.trac.wordpress.org/ticket/61133 before we move forward.
Mamaduka commentedon May 10, 2026
Closing as a duplicate.