GenerateBlocks 2.0 is here - Read the release post

Learn GenerateBlocks

Hide blocks on different screen sizes

In some designs, you may need to hide blocks based on screen size. For example: removing a sidebar on mobile devices.

Typically, this is done using CSS by setting the display property to none for the relevant screen size. GenerateBlocks makes this easy by allowing you to apply these settings directly within the block settings.

Methods of hiding blocks

There are several methods depending on your requirements and whether you’re using Free or Pro

GenerateBlocks Pro Device Visibility settings

In GenerateBlocks Pro 2.1 the much requested device visibility options will be present in the Block Settings.

GenerateBlocks Pro Global Style

With GenerateBlocks Pro Global Styles you can build your own custom classes.

  1. Create a new Global Style
  2. Switch the editor preview to device size you want to apply this to.
  3. In Styles > Layout -> Display –> Options choose Enter Custom Value
  4. In the Custom Value field add: none !important
  5. Save the Global Style.

GenerateBlocks Free

  1. Select the block you want to hide
  2. Switch the editor preview to device size you want to hide the block on.
  3. In Styles > Layout -> Display –> Options choose Enter Custom Value
  4. In the Custom Value field add: none !important

Working with hidden blocks in the editor

When using Device Visibility controls, hidden blocks will be concealed both inside the WordPress block editor and on the front end of your site. To manage these hidden blocks, you can use the List View feature to select and edit them even when they are not visibly displayed. It’s important to preview your changes on the front end to ensure the layout appears as expected across different devices.