Skip to content

Instantly share code, notes, and snippets.

@timonweb
Created March 21, 2012 16:05
Show Gist options
  • Save timonweb/2149035 to your computer and use it in GitHub Desktop.
Save timonweb/2149035 to your computer and use it in GitHub Desktop.
Deletes url aliases from a desired content type in Drupal 6
<?php
$result = db_query("SELECT nid FROM {node} WHERE type='publicprofile'");
while ($data = db_fetch_object($result)) {
db_query("DELETE FROM {url_alias} WHERE src LIKE '%s'", 'node/' . $data->nid);
drupal_set_message('Deleted alias for a node %nid', array('%nid' => $data->nid));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment