[wp-trac] [WordPress Trac] #47988: Unexpected behaviour when draft post has the same page_name as published post

WordPress Trac noreply at wordpress.org
Fri Apr 24 07:08:08 UTC 2026


#47988: Unexpected behaviour when draft post has the same page_name as published
post
-------------------------------------------------+-------------------------
 Reporter:  ajfleming                            |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Posts, Post Types                    |     Version:  2.8
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-test-info has-    |     Focuses:
  patch has-unit-tests needs-testing             |
-------------------------------------------------+-------------------------

Comment (by coviedo):

 I was able to reproduce the issue described in this ticket.

 In my local environment, I created a published post and a draft post
 sharing the same slug. Since WordPress does not allow duplicate slugs by
 default, I manually modified the slug in the database to match both posts.

 When accessing the URL while logged in, the draft post was displayed
 instead of the published one. In contrast, when accessing the same URL as
 a non-authenticated user, a 404 error was returned.

 This confirms the inconsistent behavior mentioned in the report.

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


More information about the wp-trac mailing list