Is it possible to use a number for a post/page slug? I have tried to use e.g. ‘123’ for my page slug, but each time WordPress converts it to ‘123-2’.
I’m guessing that any number is perhaps interpreted by WP as an ID. The number I want to use has nothing to do with post/page IDs. Can I get around this?
And yes, I have a good reason for using a number in stead of text in this case 🙂
Edit: On a related, more general note, what restrictions are there on what you can put in a slug? I have found that I also can’t use the + sign, though I’ve had that character in file names working just fine.
It’s only Pages where this is an issue. Posts are fine.
Seems like a bug to me, but regardless of whether or not it’s a bug, you can not use numeric slugs on pages.
This is because number slugs like “/750/” interfere with posts years “/2010/” etc. and WordPress can’t tell the difference.
If you save two pages to draft with the same number (say 750) then WordPress assigns the slug 750-2 to both. Upon publish, the first will stay 750-2 while the second will update to 750-3. There is no normal way to get slug 750 on a page as of 3.0
Update: http://core.trac.wordpress.org/ticket/11917 is the ticket that outlawed numeric slugs.