How to remove url alias when node is deleted
You can use hook_node_delete:

function hook_node_delete($node){
    // Delete alias.
    $path = path_load(
      array('source' =&gt; 'node/'.$node-&gt;nid)
    );

    path_delete($path['pid']);
}