I trying to get the existing menu items and then delete them in bulk but I’m getting an error trying to load them.
$query = Drupal::entityQuery('menu_link') ->condition('menu_name', 'mycustommenu') // Order by weight so as to be helpful for menus that are only one level deep. ->sort('weight'); $result = $query->execute(); DrupalComponentPluginExceptionPluginNotFoundException: The "menu_link" entity type does not exist. in DrupalCoreEntityEntityTypeManager->getDefinition() (line 125 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
Can someone suggest how I might do this better thanks.