Drupal - How can i enable automatic path creating for all nodes?

If you have Pathauto installed, it will generate path aliases for your nodes. It unchecks the box when there's already a path alias, letting you know that it won't change the alias if you change the content. You can change this behavior with the 'Update action' setting here: /admin/config/search/path/settings


Read the documentation page on How does Pathauto determine if the 'Automatic URL alias' checkbox should be checked or not?.

If the checkbox is unchecked on existing nodes it means that the current alias for the node does not match the alias that Pathauto "would" generate for the node. Maybe if you changed the patterns for your nodes, it would mean they're "out of sync" with the real patterns and then Pathauto un-checks the checkbox by default.


if you want to force it, even if it's unchecked,just create a module as follow :

<?php
function pathauto_checkbox_node_presave($node){
  global $user;
  if($node->type=='you_content_type'){
    $node->path['pathauto']=1;
  }
}
?>

if you want for every type just remove the "if" condition

Tags:

Path Aliases