• Ok so it’s a bit more circumstantial than that.

    I set a permalink structure of /%category%/%postname%.

    I created a category named Stories and a page named Stories. Therefore, both the page and the category slug is stories.

    The problem is that if I create a new post in category Stories and gives it a title of a number, let’s say 123, then the post’s slug will be 123 and its link will point to page Stories instead of to the post.

    However, this doesn’t happen when the post slug is not a number.

    This issue happens in a freshly installed WP without any plugin as well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • What if you do not give both a category and page the same slugs? Slugs can be edited in the page or category editors. Do you have a specific reason for doing so such as recreating a url from an old site?

    Thread Starter rechazame

    (@rechazame)

    I was wondering why no one has replied and only now I see that you did 🙂

    If I change the page slug then no – the issue doesn’t happen.

    I use the same slug because I want the page to have a clean permalink, as well as the post. Changing the slug to one of them will result in kind of an uglier permalink.

    For example:

    http://www.example.com/stories – that is the page
    http://www.example.com/stories/three-rabits – that is the post

    Changing slugs will cause permalinks to look bad.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error in post links when slug is a number’ is closed to new replies.