Title: Using Tab to indent code in code block (Gutenberg)
Last modified: March 15, 2026

---

# Using Tab to indent code in code block (Gutenberg)

 *  [bengame32](https://wordpress.org/support/users/bengame32/)
 * (@bengame32)
 * [3 months, 1 week ago](https://wordpress.org/support/topic/using-tab-to-indent-code-in-code-block-gutenberg/)
 * Hello, my name is Ben and I have been using WordPress for about 4 years.
   I need
   help regarding the Gutenberg Editor. It has a <code> block for forum posts but
   it is quite hard to use, because it does not support indent formating, because
   pressing tab does not work. I have seen forum posts regarding this topic, which
   are about 5 years old, so I assume, that there is no actual solution to this 
   issue yet. I would love to use TAB-indent in code blocks.
 * Is there a way I can fix this on my own in the mean time? Inserting a JS-Script,
   installing a plugin, pressing something like CTRL+Shift to indent instead.
 * Yes I am aware, that you can preformat the code in another program and paste 
   it. I also have a plugin called „Syntax-highlighting Code“, which helps with 
   the formating in terms of coloring. The library Prism.js helps with that as well.
 * But code with no indent is not getting any indent after the plugin or js library
   either.
 * I would love to hear some suggestions and if WordPress / Gutenberg Editor Developers
   will add a feature for this eventually!
 * Thank you so much!
   Ben

Viewing 1 replies (of 1 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [3 months, 1 week ago](https://wordpress.org/support/topic/using-tab-to-indent-code-in-code-block-gutenberg/#post-18852353)
 * I totally understand your concern. For me, the code block is also important for
   displaying code correctly, including indentation. Unfortunately, the code block
   in the Block Editor doesn’t support this, but there’s a simple reason for that:
   the Tab key is used to navigate between browser and editor components. Therefore,
   it can’t be used for indentation at the same time.
 * However, this can definitely be worked around. In the List Block, you can indent
   sub-items using the Tab key. I’m just unsure if and how this could be made possible
   in an environment like the Block Editor.
 * At the moment, I see the following options for you:
    - Take a look at this plugin: [https://wordpress.org/plugins/code-block-pro/](https://wordpress.org/plugins/code-block-pro/)–
      it provides a block that might do what you’re looking for. I haven’t tried
      it myself yet.
    - Or contact the Gutenberg team so they can take this into account during further
      development: [https://github.com/WordPress/gutenberg/issues](https://github.com/WordPress/gutenberg/issues)–
      there’s already a general issue about this: [https://github.com/WordPress/gutenberg/issues/17017](https://github.com/WordPress/gutenberg/issues/17017)

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fusing-tab-to-indent-code-in-code-block-gutenberg%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [threadi](https://wordpress.org/support/users/threadi/)
 * Last activity: [3 months, 1 week ago](https://wordpress.org/support/topic/using-tab-to-indent-code-in-code-block-gutenberg/#post-18852353)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
