Title: Block disappears when adding class &#8216;hidden&#8217;
Last modified: October 5, 2020

---

# Block disappears when adding class ‘hidden’

 *  [kristinamalm](https://wordpress.org/support/users/kristinamalm/)
 * (@kristinamalm)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/block-disappears-when-adding-class-hidden/)
 * When adding a custom css class called ‘hidden’ to a block in the gutenberg editor,
   the block immediately disappears and can’t be reached. What could be the reason
   for this?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Niall Madhoo](https://wordpress.org/support/users/nm1com/)
 * (@nm1com)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/block-disappears-when-adding-class-hidden/#post-13492562)
 * Hello [@kristinamalm](https://wordpress.org/support/users/kristinamalm/),
 * The hidden class is part of the WordPress Admin styles ([https://github.com/WordPress/WordPress/blob/master/wp-admin/css/common.css](https://github.com/WordPress/WordPress/blob/master/wp-admin/css/common.css)
   line 166. It sets the block you edited to `display: none;`, which is why it disappears.
   
   [
 * I recommend **labeling** the class **differently**, such as **“hide”** instead
   of **“hidden”** to avoid a conflict with the WordPress Admin styles.
 *  Thread Starter [kristinamalm](https://wordpress.org/support/users/kristinamalm/)
 * (@kristinamalm)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/block-disappears-when-adding-class-hidden/#post-13492627)
 * Hi Niall, thank you for a fast reply!
 * I see, then I will name it in a different way. Now I only wonder how I can get
   a hold of the hidden block and change the class (since it’s not showing in the
   GUI). Any idea? I tried to override the .hidden default styling by setting display:
   block !important but that way it only appeared on the site and not in the GUI
   editor. This feels like a bug, even if I add the .hidden class it should still
   be showing in the editor right?
 *  [Niall Madhoo](https://wordpress.org/support/users/nm1com/)
 * (@nm1com)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/block-disappears-when-adding-class-hidden/#post-13495059)
 * You’re welcome!
 * It seems like a bug to me too, or at least a design flaw. The admin styles shouldn’t
   affect the editor in this way.
 * I recommend the following to remove the class:
    - Click on the **three dots** at the **top right** of the editor
    - Click on “**Code editor,**” which will allow you to **edit** the source code
      for the page/post you’re editing
    - Look for `class="hidden"` under **“Editing code”** (the code editor) and **
      delete** the class
    - You could also use the Revisions system to restore the content before the `.
      hidden` class was added: [https://wordpress.org/support/article/revisions/](https://wordpress.org/support/article/revisions/).
      If you made changes after adding the class, you can copy/paste the new content
      after restoring the content.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Block disappears when adding class ‘hidden’’ is closed to new replies.

## Tags

 * [hidden](https://wordpress.org/support/topic-tag/hidden/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 3 replies
 * 2 participants
 * Last reply from: [Niall Madhoo](https://wordpress.org/support/users/nm1com/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/block-disappears-when-adding-class-hidden/#post-13495059)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
