Can I have single digit wordpress permalinks? Trying to force the permalink to "2" e.g. automatically rewrites it to "2-2".
Looking into it a bit further I discovered this is the case for any numerical permalink - I reckon it has to do with possible interference with paging but have a use case where I would like to use this structure..
You probably already have a post with the slug '2'; if it's not in the post administration panel, it might still be in the trash.
On a side note, using digits as slugs might not be the best idea--it could conflict with paging and other rewrite rules, and might not describe what that post is for.
Hope this helps!
actually this can be easily done from the permalinks section in the settings. You can simply set /post_id/ as the permalink structure and it will work fine.
I've dealt with this once by intercepting the post slug creation and "fixing" it somehow. Maybe you can work from this:
Do you really need single-digit slugs? If you can have your way with 00001 or 000005, the
wp_insert_post_data
filter is probably the way to go.