# Requesting help with how to remove menu items from the Jupyterlab Context menu

**URL:** <https://discourse.jupyter.org/t/requesting-help-with-how-to-remove-menu-items-from-the-jupyterlab-context-menu/3427>\
**Category:** JupyterLab\
**Created:** [February 24, 2020, 7:11pm UTC](https://discourse.jupyter.org/t/requesting-help-with-how-to-remove-menu-items-from-the-jupyterlab-context-menu/3427 "2020-02-24T19:11:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcberma](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mcberma](https://discourse.jupyter.org/u/mcberma)\
**Post date:** [February 24, 2020, 7:11pm UTC](https://discourse.jupyter.org/t/requesting-help-with-how-to-remove-menu-items-from-the-jupyterlab-context-menu/3427/1 "2020-02-24T19:11:36Z")

</div>

Need to remove a couple of menu items from the JuypterLab context menu – the context menu that displays when right mouse clicking on a Jupyter Notebook in the left document tree. I have searched the documentation and I am not able to figure that out.

---

<div class="post-metadata">

**Author:** ![jasongrout](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jasongrout/32/371_2.png) [@jasongrout](https://discourse.jupyter.org/u/jasongrout)\
**Post date:** [February 24, 2020, 7:47pm UTC](https://discourse.jupyter.org/t/requesting-help-with-how-to-remove-menu-items-from-the-jupyterlab-context-menu/3427/2 "2020-02-24T19:47:52Z")

</div>

It is easy to add menu items. It is much harder to take them away (in general, extensions shouldn’t be able to modify other extensions by taking away their features).

That said, it may make sense to have an application-wide control for a context menu. The context menu is an attribute of the application object, so you could define your own application object with its own context menu instance, which could do whatever filtering it wanted. If you want to explore this more, please open an issue in JupyterLab.

---

<div class="post-metadata">

**Author:** ![lodka](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/lodka/32/3479_2.png) [@lodka](https://discourse.jupyter.org/u/lodka)\
**Post date:** [January 13, 2021, 7:51pm UTC](https://discourse.jupyter.org/t/requesting-help-with-how-to-remove-menu-items-from-the-jupyterlab-context-menu/3427/3 "2021-01-13T19:51:47Z")

</div>

**I STRICTLY DISSAPROVE THAT BUT**  
You can try to remove commands. For example:

```auto
import { CommandRegistry } from '@lumino/commands';

interface IMenuCommands {
    _commands: { [index: string]: unknown }
}

const extension: JupyterFrontEndPlugin<void> = {
    id: 'test:plugin',
    autoStart: true,
    activate: (
        app: JupyterFrontEnd,
    ): void => {
        app.restored.then(() => {
            const itemsToRemove = ['filebrowser:cut', 'filebrowser:paste', 'filebrowser:copy']
            const commands = <IMenuCommands><CommandRegistry | IMenuCommands>app.commands;
            app.commands;
            itemsToRemove.forEach(item => {
                delete commands._commands[item]
            })

        })
    }
}
export default extension;

```

![1](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/d/d429f51f15e707d44fcc8a01f4e2c41702c13781.png)

---

<div class="post-metadata">

**Author:** ![jasongrout](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jasongrout/32/371_2.png) [@jasongrout](https://discourse.jupyter.org/u/jasongrout)\
**Post date:** [January 13, 2021, 8:09pm UTC](https://discourse.jupyter.org/t/requesting-help-with-how-to-remove-menu-items-from-the-jupyterlab-context-menu/3427/4 "2021-01-13T20:09:27Z")

</div>

> [@lodka](#):
>
> **I STRICTLY DISSAPROVE THAT BUT**  
> You can try to remove commands. For example:

I’ll also add that this approach accesses private implementation variables, so is risky and fragile and may break suddenly or have other unforeseen consequences.
