Is it possible to hide the ‘keyboard shortcuts’ button?

AI-generated summary

The discussion centers around the possibility of hiding the ‘keyboard shortcuts’ button in the Discourse sidebar. Jerome-cockpitLAB initiated the topic, and subsequently asked how to disable keyboard shortcuts entirely /#1. MihirR notes that there isn’;t a setting to disable this functionality in the admin settings, but suggests using theme components or a plugin, referencing a related meta.discourse.org post /#2. Further discussion clarified that Jerome-cockpitLAB only wants to hide the button, not disable the shortcuts themselves [/#4](/t/-/371778/4, #5](/t/-/371778/5). NateDhaliwal provided CSS code to hide the button /#7, which Jerome-cockpitLAB confirmed works /#8.

This is not the subject of this discussion, but do you know how to disable keyboard shortcuts? Thank you in advance.

Capture d’écran 2025-06-26 à 09.09.43

There is no such setting in the discourse admin settings but it’s possible with some tweaks using theme component or plug-in.

If you are disabling it maybe for this issue then have a look. Shortcuts messing with canvas focus

Or you may try this, not sure on this.

  1. Log in as an admin to your Discourse site.
  2. Navigate to Admin > Customize > Themes.
  3. Click on the ‘Edit’ button of the theme you’d like to modify or create a new theme.
  4. Go to the ‘Javascript’ section.
  5. Paste the following code:

document.addEventListener(‘keydown’, function(e) { // List of key codes or conditions to disable specific shortcuts // For example, disable ‘n’ key for new topic if (e.key === ‘n’) { e.stopImmediatePropagation(); } });

Save the changes and activate the theme.

This might help, but it’s not tested.

May I ask why you want to disable it? Just curious :slightly_smiling_face:.

Simply because it’s useless.
No one uses it.

Ah, so do you want to just hide the button in the sidebar or genuinely disable any keyboard shortcuts?

Just hide the button in the sidebar effectively.

In that case, this should work:

.sidebar-footer-actions-keyboard-shortcuts {
  display: none;
}

It works. Thank you so much Nate.