Programatically untick generate automatic URL alias for new node
Save your node twice, once to generate the alias and the second time to turn off that option for the node.

 // Save node to generate alias
 $node-&gt;save();
 // Turn off pathauto
 $node-&gt;path-&gt;pathauto = 0;
 // Save again.
 $node-&gt;save();


Then open edit form and " Generate automatic URL alias" will be unchecked.