• Using this URL structure

    /%year%/%monthnum%/%postname%.html

    posts with the same postname aren’t allowed without wordpress adding on -1 -2 etc. This is despite the month and year being different, so technically the url isn;t a duplicate but it is being treated as such. I’m migrating an large blog to wordpress and would prefer not to use 301 redirects. Is there any way to stop these incrimination’s being added?

    so for instance

    /2007/01/hello.html
    would become
    /2008/07/hello-1.html
    /2009/02/hello-2.html

    etc

Viewing 5 replies - 1 through 5 (of 5 total)
  • Could you show us how the post_name is incremented?

    As I know, in the wp_posts table, the filed is set to be auto-increment is only ID.

    Thread Starter perfectlyclear

    (@perfectlyclear)

    Here is a typical example.

    2008/07/dress-of-the-day.html is a page that exists and is viewable on the site

    but if I try to add a new post of the same title (note the different dates)
    2009/08/dress-of-the-day.html the moment you hit “update post” the URL would changes to

    2009/06/dress-of-the-day-1.html

    and if you have lots of posts entitled dress-of-the-day.html, then the increments keep getting larger i.e. -2 -3 etc.

    This wouldn’t generally be a problem as new posts can be called anything you like. But in this case I am trying to preserve permalinks and the fact that wordpress is not allowing me to have the same postname across different months means that I cannot preserve the permalink structures. If I can;t find away around this I am looking at around 1000 301 redirects, which as You can imagine I want to avoid.

    Any help would be warmly appreciated.

    Hello, please be patient.

    I think it’s possible to add a filter to solve this problem.

    I will let you know as soon as I figure it out.

    Hello, I write an article Duplicate post name in WordPress to solve this problem.

    Hopefully it will work for you.

    Thread Starter perfectlyclear

    (@perfectlyclear)

    worked perfectly, thanks a million ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Permalinks, duplicate posts and incrementation’ is closed to new replies.