[wp-trac] [WordPress Trac] #57507: function wp_unique_post_slug inconsistent for numerical page slugs, e.g. 404

WordPress Trac noreply at wordpress.org
Wed Sep 3 17:11:22 UTC 2025


#57507: function wp_unique_post_slug inconsistent for numerical page slugs, e.g.
404
-------------------------------------+------------------------------
 Reporter:  arve5                    |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Rewrite Rules            |     Version:  6.1.1
 Severity:  minor                    |  Resolution:
 Keywords:  close reporter-feedback  |     Focuses:  administration
-------------------------------------+------------------------------
Changes (by SirLouen):

 * keywords:  dev-feedback has-test-info => close reporter-feedback
 * component:  Posts, Post Types => Rewrite Rules


Comment:

 @arve5 I don't fully understand what you are expecting

 Numbers are not valid and they will end as `-2` as you can observe through
 that regex.
 Related #63508, got closed for pretty much the same reasons of this topic.

 > Suggestion: Either allow numerical slugs if it does not interfere with
 paginations, or disallow it with a warning.
 Anyway to this extent, I agree with you, I also had to dig further back in
 the day to identify the culprit of why the numeric slugs were "disallowed"
 inside hierarchical posts. I could not find clear docs on why this was
 happening.

 The only way to override this is by shortcircuiting
 `pre_wp_unique_post_slug`.

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


More information about the wp-trac mailing list