How to make custom URL mandatory?
The path alias is a field, so you just need to alter the form and set the #required property on the element:

function module_form_node_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
  $form['path']['widget'][0]['alias']['#required'] = TRUE;
}