Make WordPress Core

Opened 8 months ago

Closed 8 months ago

#63508 closed defect (bug) (duplicate)

Numeric Slugs break on Child Pages

Reported by: sirlouen's profile SirLouen Owned by:
Milestone: Priority: normal
Severity: major Version:
Component: Permalinks Keywords: needs-patch good-first-bug needs-test-info
Focuses: Cc:

Description

Bug Report

Description

When creating a numeric slug as a child page, system ads a -2
For example if you want to have something like /exhibitions/2025 it will switch to /exhibitions/2025-2

For reference #5305 #14238

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 137.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty 2.9
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Reproduction Instructions

  1. Switch to postname Permalinks (Settings > Permalinks)
  2. Create a Parent page
  3. Create a Page with a number and set the Parent page as Parent
  4. 🐞 Check the slug, not respected, ads a -2 (check screenshot attached)

Expected Results

  1. ✅ URL should be like /parent/2025/

Actual Results

  1. ❌ URL is /parent/2025-2/

Supplemental Artifacts

Demo Screenshot

https://i.imgur.com/IABtkUs.png

Change History (2)

#1 @SirLouen
8 months ago

  • Keywords needs-test-info added

#2 @dd32
8 months ago

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

This is an intentional "feature", as /pagename/2 refers to page 2 of the content of pagename.

Duplicate of #46172, #14238, and #5305.

Per https://core.trac.wordpress.org/ticket/46172#comment:3

numeric-only slugs are not supported as of [13424]/#11917. If you think they are working on your site you can give https://wordpress.org/plugins/allow-numeric-stubs/ a try.

Note: See TracTickets for help on using tickets.