How to add field to menu I want to add a description field to my menu and and use it in front.

I managed to have a text_format field for my description (in /admin/structure/menu/manage/main) but when I click on save, that field is empty.

function HOOK_form_alter(&amp;$form, $form_state, $form_id) {
  if ($form_id != 'menu_edit_form') {
    return false;
  }
  $form['field_menu_content'] = array(
   '#type' =&gt; 'text_format',
   '#title' =&gt; t('Description'),
   '#format' =&gt; 'full_html',
  );
}
In hook_form_alter() add a submit function:

$form['#submit'][] = 'my_module_menu_edit_submit';


Where you store the field:

function my_module_menu_edit_submit($form, FormStateInterface $form_state) {
  $config = \Drupal::service('config.factory')-&gt;getEditable('mymodule.settings');
  $config-&gt;set('main_content', $form_state-&gt;getValue('field_menu_content'))
    -&gt;save();
}


The main menu is hard coded in the settings name. If you want this to work for all menus, you can try to get the menu name from the form. I did not investigate where you can get it.

When you build the form field you also need to get the field value from config. More information: https://www.drupal.org/docs/8/api/configuration-api/simple-configuration-api