How to: Re-alias a pile of nodes after they've already been aliased

Last modified: September 12, 2009 - 19:36

So you've got your blog all set up. You've installed the Pathauto module and set your blog posts to have an alias of (for example):

/content/my-new-blog-post

You already have 25 posts and are ready to let it out there for all the world to see.
While surfing around the web, you realize that lots of other blogs have their URLs formatted as follows:

2009/02/31/my-new-blog-post

And you, of course want to have those cool date-style aliases, too!

What to do?

  1. Go to the URL alias admin screen: Home » Administer » Site building » URL aliases.
  2. Go to the Delete aliases tab at the top, and delete the aliases that you want to change. Note: This will NOT delete the posts, it will only delete the aliases - i.e.: it will revert the post's URL from /content/this-is-my-blog-post back to /node/25, the default Drupal path.
  3. Go to the Automated alias settings tab, open the Node path settings tab and put in the path format you want (in this case: [yyyy]/[mm]/[dd]/[title]) in the field of the appropriate content type (in this case: blog post).
  4. Check the Bulk generate aliases for nodes that are not aliased checkbox.
  5. Click Save configuration at the bottom of the page.

Now that all of your aliases have been deleted, the Bulk generate option will create them all again - this time in the format you want. It doesn't overwrite existing aliases, so you have to delete the 'wrong' ones, before it will remake them.

Another Option

At Administer, Content (admin/content/node) select all the nodes whose path you want to rename. In the Update Options drop-down list select Update Path Alias then click the Update button.
This should work for Drupal 5 and Drupal 6.

 
 

Drupal is a registered trademark of Dries Buytaert.