It should look something like this: /** * Update path aliases for taxonomy terms and nodes. */ function gateway_controller_update_7057() { module_load_include(‘inc’, ‘pathauto’); module_load_include(‘inc’, ‘pathauto.pathauto’); // Delete the existing node aliases. db_delete(‘url_alias’) ->condition(‘source’, ‘node/%’, ‘LIKE’) ->execute(); // Regenerate the node aliases. $nids = db_query(“SELECT nid FROM {node}”)->fetchCol(); pathauto_node_update_alias_multiple($nids, ‘bulkupdate’); // Delete the topics taxonomy aliases. db_delete(‘url_alias’)… Continue reading Regenerating Path Aliases Programatically in Drupal 7