# Remove menu/buttons: is this possible?

**URL:** <https://forums.unrealengine.com/t/remove-menu-buttons-is-this-possible/210575>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [March 15, 2021, 5:22pm UTC](https://forums.unrealengine.com/t/remove-menu-buttons-is-this-possible/210575 "2021-03-15T17:22:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jobim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jobim](https://forums.unrealengine.com/u/jobim)\
**Post date:** [March 15, 2021, 5:22pm UTC](https://forums.unrealengine.com/t/remove-menu-buttons-is-this-possible/210575/1 "2021-03-15T17:22:03Z")

</div>

Hi, I want to create a “mod” of the unreal editor: I’d like to:

- replace top file/edit/window/help menus with new menus
- change contextual menus
- remove safe / modes / content / etc… buttons and replace them with new buttons.

Is this possible? Do I have to use C++ or is python enough?  
Can you give me some hints?  
Thank you very much.

---

<div class="post-metadata">

**Author:** ![Andreas\_Ranman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andreas\_Ranman](https://forums.unrealengine.com/u/Andreas_Ranman)\
**Post date:** [March 19, 2021, 10:39am UTC](https://forums.unrealengine.com/t/remove-menu-buttons-is-this-possible/210575/2 "2021-03-19T10:39:40Z")

</div>

Sure it’s possible, but seems like a very heavy handed mod.

```auto

"""

  Example of removing existing menu items, and replacing with your own menu

"""

import unreal

def main():

  menus = unreal.ToolMenus.get()

  # Get the main menu,
  main_menu = menus.find_menu("LevelEditor.MainMenu")

  # List all the default registered menus at top of the window,
  menu_to_delete = 
    "MainFrame.MainMenu.File",
    "LevelEditor.MainMenu.File",
    "MainFrame.MainMenu.Edit",
    "LevelEditor.MainMenu.Edit",
    "MainFrame.MainMenu.Window",
    "LevelEditor.MainMenu.Window",
    "MainFrame.MainMenu.Help",
    "LevelEditor.MainMenu.Help",
  ]

  # For each reg istered menu, drop all entries and remove the menu,
  for name in menu_to_delete:
    menus.unregister_owner_by_name(name)
    menus.remove_menu(name)

  # Lastly drop the entries under MainMenu, otherwise we will have
  # menu buttons [File, Edit, Window, Help] without anything under
  menus.unregister_owner_by_name("MainMenu")

  # Add our own submenu
  my_menu = main_menu.add_sub_menu(
    owner = "LevelEditor.MainMenu",
    section_name = "Section",
    name = "My.Menu",
    label = "Fizzbuzz",
    tool_tip = "We replaced the old items with our own!"
  )

  # Just add some entries to this menu for display purposes,
  for name in "Foo", "Bar", "Baz"]:
    e = unreal.ToolMenuEntry(
      name = name,
      type = unreal.MultiBlockType.MENU_ENTRY,
    )
    e.set_label(name)
    my_menu.add_menu_entry("Items", e)

  menus.refresh_all_widgets()

if __name__ == ' __main__':
  main()

```

To get the names I looked in MainMenu.cpp and LevelEditorMenu.cpp

![removed-menu.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/6/5/654b2c2ce85585f93cc6649cc8157b2f06b9686e.png)

You can also set “display ui extension points” through editor settings and have green texts to give you hints on the menu names.

---

<div class="post-metadata">

**Author:** ![jobim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jobim](https://forums.unrealengine.com/u/jobim)\
**Post date:** [March 19, 2021, 11:49am UTC](https://forums.unrealengine.com/t/remove-menu-buttons-is-this-possible/210575/3 "2021-03-19T11:49:18Z")

</div>

Great, thank you very much!
