Setting link field in menu content item as not required I am trying to make a field not required in drupal 8 through hook form alter in the following way, which does not seem to work:

function mymodule_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
  if ($form_id == "menu_link_content_menu_link_content_form") {
    $form['link']['#required'] = FALSE;
  }
}
To get this working in the form alter hook you need to set #required to FALSE in the widget:

$form['link']['widget']['0']['uri']['#required'] = FALSE;


The red asterix mark for a required field is no longer there, but the form does not validate. To get the form validated you would need to do this in the field definition. Implement a hook hook_entity_base_field_info_alter and set required to FALSE:

function mymodule_entity_base_field_info_alter(&amp;$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type) {
  if ($entity_type-&gt;id() == 'menu_link_content') {
    $fields['link']-&gt;setRequired(FALSE);
  }
}


But this doesn't help either, because there is code in the menu link content class that depends on $this-&gt;link, so even if you manage to pass the validation you get an error later, that the link is missing.