Make WordPress Core

Opened 7 years ago

Closed 14 months ago

#39279 closed defect (bug) (invalid)

Media gallery in WP 4.7 has incorrect permalinks for PDF's

Reported by: marcoevich's profile Marcoevich Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords: close
Focuses: Cc:


Ever since updating my site to WP 4.7, the media gallery displays incorrect permalinks for PDF's. They are not in the uploads directory, but relative to the homepage. This permalink is incorrect and will redirect to the homepage.


Attachments (1)

211cc84ebc414a64ad69a2d269ea77a4.png (28.3 KB) - added by Marcoevich 7 years ago.
Image which clearly displays the issue

Download all attachments as: .zip

Change History (7)

7 years ago

Image which clearly displays the issue

#1 @swissspidy
7 years ago

  • Keywords close added
  • Version 4.7 deleted

Hey there,

Media files are accessible on the website like posts and pages. When your permalink structure is /%postname% and the media file is not attached to a post, is the correct permalink for an attachment. This has been the case for quite a while.

If you want the URL for the actual file inside wp-content, have a look at the meta box on the right of the screen.

#2 @Marcoevich
7 years ago

Thank you for pointing me at the metabox. I totally missed that :)

But still, the permalink which can be seen in the attached picture is not working. When I click on it, it redirects me to the homepage instead of to the file (which I expect it would). Is that how it's supposed to work then?

#3 @joemcgill
7 years ago

Hi @Marcoevich,

That link should direct you to the attachment page (more like a post for your media item) rather than the URL for the file itself. Can you reset your permalinks and retry to make sure that the URL is being recognized by WordPress?

#4 @Marcoevich
7 years ago

It works when I set the permalink structure to it's default setting. I saw the attachment page. However when I change the permalink structure back to post name, that link doesn't work again, going back to homepage.

Last edited 7 years ago by Marcoevich (previous) (diff)

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.

14 months ago

#6 @antpb
14 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi @Marcoevich this ticket was brought up in the recent Media component meeting. it seems this is not valid now 6 years later. Thank you for this report, and if you see any other issues feel free to create a new ticket!

Note: See TracTickets for help on using tickets.