Drupal Pathauto Module

The Drupal pathauto module is a great tool for giving your content names based on the content titles. For example, the title of this blog post (node) is "Drupal Pathauto Module" so once it is saved with an automatic alias, the URL alias will be "drupal-pathauto-module" which is much easier to remember than node/9.

So, to get your SEO-friendly URLs, simply:

1) download pathauto
2) untar the files and place in sites/all/modules/pathauto directory
3) enable path and pathauto modules at system/build/modules
4) configure pathauto at admin/build/path/pathauto (Drupal 6) or admin/settings/pathauto (Drupal 5)

Now whenever you create new content, you can leave the "automatic alias" box checked and it will create the URL alias for you. Or, if you want to create your own custom alias, un-check the box and type in your alias. NOTE: AS OF CURRENT WRITING, EVERY TIME YOU EDIT THE CONTENT/NODE LATER, YOU WILL NEED TO UN-CHECK THIS BOX, WHICH IS AN ANNOYING BUG.

If you have old content that needs aliases, you can edit the pathauto settings for the particular content type. For example, I have some old blog posts that I created before adding pathauto, so I can:

1) go to admin/build/path/pathauto
2) open the Blog path settings section
3) click "Bulk generate aliases for blogs that are not aliased" checkbox
4) click save configuration

Then, all old content should have new aliases.

Important note: if you are going to be using aliases with either the path or pathauto module, make sure to prevent your site from having duplicate content.

Comments

When deleting node the pathauto aliases remain :((

I am deleting mass content from a site and i need to delete all the unused aliases,
could you please provide me a way to delete them?
i am near 200.000 aliases and the drupal keeps being out of memory with almost 70mb php execution size :((((((((

Deleting orphaned aliases

I'm surprised that the aliases are still there after deleting the node, but you can delete them individually through:

Site Building > URL Aliases > Delete Aliases

or if you have a bunch, there is a way to deal with them in SQL here:

http://drupal.org/node/195120

Good luck,
Kristen

Post new comment - ALL COMMENTS ARE MODERATED - SPAM WILL BE DELETED!

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.

I'm a Speaker at DrupalCon Austin

I'm a Speaker at DrupalCon Portland