• cent

    (@cent)


    Hi,

    We recently moved a site from an old legacy blog app to WordPress. The old system didn’t use post slugs which was fine as we were using ?p= for permalinks. Now that we want to move to cleaner permalinks like /%year%/%month%/%title%, we need to go back and add post slugs to a few hundred posts.

    I couldn’t find a WP plugin which will do this. We could potentially write a PHP script to do this for us but was wondering if there was something already available?

    Also, if we go down the custom route, one question. If a post from 1-1-06 has a title of “my blog post” and a post from 8-1-06 has the same post title, I assume WP will be able to know the difference based on the month/year? Also if there are 2 posts in the same month with the same title, is it customary to just add a number at the end?

    Thanks in advance.

    Best,
    Cent

Viewing 1 replies (of 1 total)
  • stvwlf

    (@stvwlf)

    You can see how WP calculates a unique slug in function wp_unique_term_slug() in file /wp-includes/taxonomy.php

    You can probably use some of the existing routines in that file in your scripts instead of starting from scratch

Viewing 1 replies (of 1 total)
  • The topic ‘Adding Mass Post Slugs’ is closed to new replies.