Skip to content

How to Create a Collapsible Section in WordPress?

Key Takeaways

  • Nexter Blocks Expand block turns any content into a collapsible panel in the WordPress block editor.
  • Expand block supports three content sources: Text, Pattern, and Editor, with Editor allowing images and videos inside the collapsible section.
  • Expand block places toggle buttons above or below the content and adds an extra button with text, an external link, and an icon when expanded.
  • Expand block includes Extra Options for Max Height, Custom Opacity, and Transition Duration, plus Style tab controls for title, description, toggle button, and extra button.
Table of Contents

A wall of text at the top of a page asks the reader to commit before they know whether it is worth it.

The Expand block shows the first part, then lets them open the rest — and what it hides can be text, a saved pattern, or any blocks you like.

Before You Start

  • Edition: Pro — the Expand block is part of Nexter Blocks Pro.
  • Block to enable: Expand, switched on under Nexter > Blocks in your WordPress dashboard.
  • Content longer than the collapsed height, or there will be nothing to expand.

Steps

  1. Add the Expand block to your page and click Design from Scratch.
  1. Type a Title if you want one above the box.
  1. Set Content Source to Custom Content.
The Content Source setting
  1. Type or paste what should be hidden into Content.
The Content field
  1. In Extra Options, set Max Height — how tall the box is before anyone clicks. Make it shorter than your content.
The Max Height setting
  1. Set the Text for the open and closed labels.
The expand and collapse label fields
  1. Publish and click the toggle.

Max Height has to be smaller than your content. If the content already fits, there is nothing to collapse and the toggle does nothing useful — measured with a short paragraph in a 100 pixel box, where expanding actually made the box smaller.

Three Ways to Fill the Box

Content SourceWhat goes insideGuide
Custom ContentText typed into the blockRead more toggle for text
EditorAny blocks placed inside the Expand blockLoad more button
PatternA saved patternUse a pattern in the Expand block

What Each Panel Controls

PanelWhat you set there
ContentThe title, where the content comes from, the toggle labels and icon, and its alignment
Extra OptionsThe collapsed height, the fade over the cut-off, and how long the animation takes

How It Behaves

  • All three sources really work. Measured by clicking the toggle: custom text opened from 100 to 319 pixels, a pattern from 100 to 165, and blocks placed in the editor from 100 to 665. Each collapsed back on a second click.
  • Max Height is the closed height. Set it to 60 and the closed box measured exactly 60.
  • The toggle is a real button, so keyboard users can reach and operate it.
  • Custom Opacity fades the bottom of the collapsed box so the cut-off looks deliberate rather than chopped.
  • Extra Button adds an ordinary link beside the toggle — useful for Watch video next to Read more. It does not expand anything itself.

Limitations

  • Pro only.
  • Max Height has to be smaller than your content. If the content already fits, there is nothing to collapse and the toggle does nothing useful — measured with a short paragraph in a 100 pixel box, where expanding actually made the box smaller.
  • The AJAX option does not work. With a pattern set to load over AJAX, the box opened completely empty and no request was made at all — the script that would fill it is never loaded. Leave it off and use the plain pattern source.
  • Hidden content is still in the page’s HTML, so this is a presentation choice, not a way to keep anything private or to reduce what the page downloads.
  • One expandable area per block. For several independent sections, use several blocks.

Troubleshooting

The toggle does nothing

Your content is probably shorter than Max Height, so there is nothing to reveal. Lower the Max Height.

The box opens but is empty

If you are using a pattern with the AJAX option on, turn that option off — the content is never fetched. Otherwise check the pattern still exists.

The cut-off looks abrupt

Switch on Custom Opacity in Extra Options and set its height and colour to match your background.

The animation is too fast or too slow

Change Transition Duration (0 – 5000). It is in milliseconds, and 200 is the default.

The block is missing from the inserter

Switch Expand on under Nexter > Blocks in your dashboard.

Expand switched on in the Nexter Blocks list

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!

Related Frequently Asked Questions

Why is the Expand block not showing in WordPress?

The Expand block only appears when the default WordPress Block editor is active and the Nexter Blocks plugin is installed and activated. It is also a Premium block, so the PRO version of Nexter Blocks is required. If it still does not appear, the usual miss is that the block itself has not been turned on under Nexter → Blocks. That activation step matters because the block stays hidden until it is enabled.

What can I use a WordPress expand block for on a page?

Nexter Blocks uses the Expand block to turn any content into a collapsible panel, which is useful when you want to reduce clutter and keep a page easier to navigate. The page specifically calls out that collapsing sections help you add elements without compromising the overall design. That makes it a practical fit for long pages where you want content available without showing everything at once.

Can I add images or videos inside a collapsible section in WordPress?

The Editor content source supports richer content inside the Expand block, including images and videos. That matters because it lets you build a collapsible panel with more than plain text, instead of being locked into a simple text-only accordion style. If you want to keep media tucked away until someone expands it, the Editor option is the one built for that use case.

What is the difference between Text, Pattern, and Editor in the Expand block?

Text is for adding content directly in the editor, Pattern lets you build content with Gutenberg blocks as a reusable pattern, and Editor lets you use the WordPress block builder inside the Expand block itself. The practical difference is control: Text is simplest, Pattern is good when you want a structured layout, and Editor gives the most flexibility for mixed content like images and videos.

How do I make an expandable section easier to use on mobile?

The Extra Options tab includes Max Height, which lets you set the initial height of the collapsible container for different devices. That matters on smaller screens because too much visible content can make the section feel heavy before it is expanded. The same tab also includes Custom Opacity and Transition Duration, so you can tune how much overlay shows and how fast the panel opens or collapses.

What styling options are available for a WordPress expand block?

The Style tab covers the title, description, toggle button, and extra button. For the title, you can adjust typography, color, alignment, and margin. For the toggle button, there are controls for padding, margin, width, typography, color, background, icon size, placement, and color. Nexter Blocks also lets you style an extra button separately if you turn that feature on.

Last reviewed: September 15, 2026

Related Docs