Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When I create a page whose title contains only digits - wordpress adds '-2' to the url, like it does in cases, where there is a page with the same name already existing. However this is not the case here.

Example: If I create a page titled 909303, the url will be: ../909303-2/

I want it to be ../909303/. How do I do that conveniently?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

well.. it is not exactly the case, but in a way, it is . every page has actually "2" names , one is the name you give and one is the ID, which is the number. If you will give a "name" which is a "number" - it might override another entity (Can be a post, page , attachment, or even a draft) with the same ID. that would result in multiple errors and 404 , depending on your permalink structure.

SO , it is not such a good idea to do that, but if you really want to go with it first try to change your permalink structure and if that does not work, you will need to hook the sanitize_title() - but I will still advise to avoid such a practice.

( read here for more: http://core.trac.wordpress.org/ticket/5305#comment:25 - it is an old post from previous wordpress releases - , but maybe will let you understand WHY it is doing what it does.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.