# How to disable developer shortcuts?

**URL:** <https://forum.xwiki.org/t/how-to-disable-developer-shortcuts/6211>\
**Category:** Help / Discuss\
**Created:** [February 3, 2020, 9:49pm UTC](https://forum.xwiki.org/t/how-to-disable-developer-shortcuts/6211 "2020-02-03T21:49:31Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![danielk117](https://forum.xwiki.org/user_avatar/forum.xwiki.org/danielk117/32/4817_2.png) [@danielk117](https://forum.xwiki.org/u/danielk117)\
**Post date:** [July 3, 2025, 8:12am UTC](https://forum.xwiki.org/t/how-to-disable-developer-shortcuts/6211/11 "2025-07-03T08:12:59Z")

</div>

The “removing all shortcuts” snippet is wrong. You need to use `for .. of` instead of `for ... in`. Like this:

```js
// Removing all shortcuts at once
for (binding of shortcut.all_shortcuts()) {
  shortcut.remove(binding.keys.join(' '));
}

```

I’ve added it to a JavaScriptExtension on our theme. It seems that the script is executed to early or the shortcuts were added again.

So my working solution for now is something like this:

```js
function removeShortcuts() {
  shortcut.remove('alt a');
  shortcut.remove('alt s');
}

document.addEventListener("DOMContentLoaded", removeShortcuts);
document.observe("xwiki:dom:loaded", removeShortcuts);
document.observe("xwiki:dom:updated", removeShortcuts);

```

---

_[View the full topic](https://forum.xwiki.org/t/how-to-disable-developer-shortcuts/6211)._
