Archived topic
WordPress Adding "-2" to number-only page slugs
4 replies · Started by Brent Wilson on March 10, 2022
I have run into an issue. When I add a new page with a number-only slug (like 2020), a "-2" is being added to the end of the slug when I publish. As far as I can tell, this is not related to that slug already being used. I have also tried publishing a page with a word instead of only numbers for the slug, and it seems to be functioning properly. Any idea what might be causing this "-2" to be added to number-only page slugs?
Here is a Loom video showing the weird behavior that I am experiencing: https://www.loom.com/share/dc640ea910834e3183e24a50e99eec42
Hi Brent,
This is the default behavior of WordPress when the slug is already used.
Specifically, numerics slugs are not allowed because it conflicts with WordPress’ paging functionality. It is disabled by default. Numeric slugs are automatically appended with a -2.
Hope this clarifies. :)
Oh, okay. I guess I hadn't realized that. Thanks for clarifying it for me.
You’re welcome Brent! :)