In Drupal 10, there may be instances where you need to programmatically control the URL alias generation for nodes. Specifically, you might want to uncheck the "Generate automatic URL alias" option when creating or updating nodes. This is useful in scenarios where you need more control over the URLs of your content, such as when implementing custom SEO strategies.
In this blog post, we'll explore how to achieve this using Drupal's API.
Introduction
Drupal's Pathauto module is commonly used to generate URL aliases based on configurable patterns. However, there are times when you might need to disable this automatic alias generation for specific nodes. This can be done programmatically by modifying the node's path property.