I'm using drupal 7 in combination with path auto. I imported nodes of a specific content type using the feed importer, but the url alias is not set correctly.

My problem is, that i can not use the bulk update for content paths, because there is other content, that was migrated manually and that uses non generic url-aliases.

Is there a way to trigger the bulk alias update for a specific content type?

3 Answers 3

  • To update URL for Existing Contents You could go to admin/content
  • In Update Options, You can choose Update URL alias after filtering a specific content type

enter image description here

  • 3
    Just for everyone else' knowledge, I think the "Update Options" drop down menu shown in the screenshot above, is provided by Views Bulk Operations module (VBO): drupal.org/node/1326928 (it wasn't mentioned entirely in the question or answer). Feb 20, 2017 at 13:46
  • This action is in Drupal 8/9 (in the Action dropdown) at admin/content. It is provided by Pathauto.
    – mlncn
    Apr 9, 2021 at 13:52

In the settings you can chose what updating needs to do if there already is an alias. Under 'Update action' select 'Do nothing. Leave the old alias intact'. Then do a bulck update.

  • Thanks for your answer. But that will not work for me because the nodes already have an existing alias, but it was not set correctly (the pattern was not used).
    – sgoelz
    Jan 9, 2015 at 15:03
  • After searching the web for solutions i think, that VBO is the best way to do this
    – sgoelz
    Jan 9, 2015 at 15:04

If you're comfortable using SQL, you can do the bulk operation against the database without involving Drupal.

I'd recommend testing the query against a slave, staging or non-production instance of the database to verify the results first, just to be safe:

SELECT alias FROM node
JOIN url_alias
ON CONCAT('node/', node.nid) = url_alias.source
WHERE node.type= 'machine_name';

After you've carefully reviewed the query to verify the results, perform the actual delete:

DELETE url_alias FROM node
JOIN url_alias
ON CONCAT('node/', node.nid) = url_alias.source
WHERE node.type = 'machine_name';

If you don't have access to MySQL database or Drush, you can perform the operation by using a custom Views Bulk Operation or by using Drush:

$ drush sql-query "DELETE url_alias FROM node [...]"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.