Starting Over - Clearing your Aliases Completely Or Selectively
Bulk Update All Objects
Older versions of Pathauto (4.7 and 5.x-1) regenerate all aliases of the requested type during a bulk update when the Update action (at Administer > Site Configuration > Pathauto > under General Settings) is set "Create a new alias, replacing the old one."
Bulk update replaces all old aliases with new ones. However, this bulk update created problems, such as incomplete updates and/or server time-outs, for very large sites and/or on particularly slow servers.
Bulk Generate For Non-Aliased Objects Only
As of Pathauto 5.x-2.x or Pathauto 6.x-1.1, bulk update only generates aliases for non-aliased objects - if a node already has an alias, it will not be updated during the bulk update. You might run into problems if you add feed aliases or tracker aliases to an already aliased object. It is best to delete the object's alias and bulk update them.
Deleting all aliases
To regenerate all aliases from a clean slate, Pathauto 5.x-2.x and Pathauto 6.x-1.1 provides a "Delete all aliases" option. You can selectively delete by "all aliases", "users", "content", "user blogs", "vocabularies and terms", and "user trackers".
In Pathauto 5.x-2.x the "Delete all aliases" options can be found at: Administer > Site Building > URL Aliases > under the "Delete all aliases" tab (admin/build/path/delete_all).
In Pathauto 6.x-1.1 the "Delete all aliases" options can be found at: Administer > Site Building > URL Aliases > under the "Delete all aliases" tab (admin/build/path/delete_bulk).
Warning: This will permanently delete aliases from your site. You will not be asked again "are you sure you want to delete all aliases?"
Updating aliases of a certain node type
There is no option within Pathauto for updating only a particular node type, while leaving other nodes untouched. But there is a simple procedure for doing this if you don't have too many nodes you need updating. Works for both Pathauto 5.x-2.x and Pathauto 6.x-1.1.
- Set what you would like done with existing aliases in Pathauto "General Settings":
- Do nothing. Leave the old alias intact.
- Create a new alias. Leave the existing alias functioning.
- Create a new alias. Delete the old alias.
- Create a new alias. Redirect from old alias. (depends on Path Redirect)
- Go to "admin/content/node"
- Filter by content type
- Select all nodes
- Select "Update path alias" from drop down
- Repeat for number of pages you have of that content type
You can also selectively delete aliases by running advanced queries against your database. For example, the following query will delete all node objects:
DELETE FROM url_alias WHERE src LIKE 'node/%';
OR
DELETE FROM url_alias WHERE dst LIKE 'my_custom_pattern/%';
If you need to delete the aliases of a range of nodes by nid you could use the code:
// delete url aliases between nid 22060 and 22433
$nid = 22060;
while ($nid < 22434) {
db_query("DELETE FROM {url_alias} WHERE src LIKE 'node/%d'", $nid);
$nid++;
}
Performing bulk updates in configurable chunks
For sites that need to generate large numbers of aliases or sites that run on slow servers, Pathauto 5.x-2 offers the option to perform bulk updates in configurable chunks - you can specify the number of objects to alias in each bulk update.
Note: if you set the limit to 50 objects per bulk update and have feed aliases enabled, then
100 new aliases should be generated per bulk update (2 aliases per object).
Note: If you are concerned about the effect of bulk update on your site, you should
backup your database (particularly the url_alias table) prior to executing the Bulk update.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion