Changing existing URL paths in pathauto

Using the Pathauto module is a quick and easy way of automatically creating meaningful URL's. Instead of having to type in a URL path manually for each node (page, story etc) yourself, it will do it automatically based on set criteria, like the category it belongs to and the title.

But it does become troublesome when you decide that you want to change your URL path's for what ever reason. Here is a simple way to do change the URL paths in bulk:

1) Back up your database! Things can do wrong with changing aliases, especially with big databases. So it is always wise to back up first.

2) You need to delete existing URL path's before you create the new ones.
You can do this by going to:

Admin -> Site building -> URL aliases -> Delete aliases.

Delete aliases is a tab in the URL aliases section. Decide whether you want to delete all paths, just content (nodes), vocabularies and terms (categories), user blogs or user trackers. Hit delete aliases now.

3) Go to Admin -> Site configuration -> Pathauto.
Change the path aliases to what ever you want.

4) Click save configuration

5) Your new aliases should now be set. Do through some of your content just to make sure.

Now that wasn't very difficult was it!

If you liked this, you'll love my book, Master Drupal Module Development.

"..the must have drupal developers book"

Feeling stuck with Drupal 8 module dev?

Get the free 7 lesson course that will help you get started today without feeling overwhelmed.

  • Create Drupal modules with just a few commands using the Drupal Console
  • Create custom pages
  • Create custom blocks
  • Create admin forms
  • Demystify routers and controllers
  • Bonus material

Find out more

Add new comment