How to delete a path when uninstall a module? this is for Drupal 8:

in my hook_install function, i have following code:

MenuLinkContent::create([
        'title' =&gt; 'Location',
        'link' =&gt; ['uri' =&gt; 'route:locator.filters'],
        'menu_name' =&gt; 'main',
    ])-&gt;save();


when I have uninstalled my module, how do remove above defined link?
You can use hook_uninstall and MenuLinkManager::removeDefinition


  Removes a single link definition from the menu tree storage. This is
  used for plugins not found through discovery to remove definitions.