[wp-trac] [WordPress Trac] #61824: Pages no longer allowed to have same permalink as images

WordPress Trac noreply at wordpress.org
Mon Oct 7 11:04:56 UTC 2024


#61824: Pages no longer allowed to have same permalink as images
--------------------------+------------------------------
 Reporter:  thommo        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Permalinks    |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------

Comment (by thommo):

 Hi Tonya,
 Thanks for looking into this.
 I recognise that you and @peterwilsoncc are both saying that "attachments
 and pages can't share the same post slug". However, it is possible for an
 image and a page to have the same post_name in the DB (or, at least, it
 used to be possible prior to the update). This is possibly just for very
 old content as the site was originally built a number of years ago.
 Nevertheless, the site would display the page without problems (eg
 https://domainname.com/sausages) and it would also happily include the
 image in any content (eg https://domainname.com/wp-
 content/uploads/2024/08/sausages.jpg).
 When the update was applied to the site, going to the page URL,
 unexpectedly now returned a 404.
 I may be wrong but it looks to me as if patch 60941.diff caused this
 change in behaviour. If it was a deliberate consequence of the change
 then, it seems to me, that some sort of warning that page URLs with a
 post_name matching to media, may now suddenly return a 404, would have
 been helpful.
 In our situation, the image and the page had different URLs. I can
 understand the issue if they both had the same URL. Would it have been
 possible to add this restriction on identical post_names only when it
 applied?
 Thanks

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61824#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list