12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Jan 6, 2020

How to Hide Oxygen Elements inside Gutenberg

David Browne

There’s a number of reasons why we may want to hide some elements on a page when making the page ‘editable in Gutenberg’. Here’s how to do it…

fixed element overlapping SEO metabox

A common reason for wanting to hide elements are when the elements are fixed. They can cover some of the content and the meta boxes below Gutenberg, making it difficult for content editors to access some of the settings.

Another reason might be that some of the blocks are dynamic and don’t need to be edited inside Gutenberg, so we may wish to hide them.

Simple Solution with CSS

We can target just the elements that we want to remove by giving them all the same class, say, ‘hide-in-editor’ and then adding this CSS to a stylesheet inside Oxygen.

.hide-in-editor.oxygenberg-element {
    display: none;
}

All done

These elements will still be visible when viewing inside Oxygen’s builder and will remain on the front end of the site, they just won’t be visible inside the Gutenberg block editor.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right