How to Add Collapsible/Expandable Content in WordPress

How to Add Collapsible/Expandable Content in WordPress

Have you ever scrolled through a lengthy webpage, struggling to pinpoint the exact information you need? It’s frustrating, isn’t it? The solution lies in collapsible and expandable content, which is a simple yet effective way to organize information.

This technique lets you present detailed content while keeping your pages clean and easy to navigate. Whether it is FAQs, product descriptions, or blog posts, collapsible sections enhance usability and engagement.

The good news? You don’t need to dive into coding to implement it. With WordPress, tools like the Ultimate Blocks plugin make it incredibly simple. Ultimate Blocks, a specifically designed plugin for Gutenberg users, offers features like the Content Toggle and Expand blocks to allow you to create interactive and collapsible sections. 

Method 1: Using the Ultimate Blocks Plugin

Step 1: Install the Ultimate Blocks Plugin

Navigate to your WordPress dashboard, go to the “Plugins” section, and click “Add New.” Type “Ultimate Blocks” into the search bar, locate the plugin in the results, click “Install Now,” and then “Activate.”

Install the Ultimate Blocks Plugin

Step 2: Add the Content Toggle Block

Open the post or page where you want to add collapsible content. Click the “+” icon in the WordPress editor to add a new block, search for “Content Toggle,” and select it. 

Add the Content Toggle Block

Once you’ve added the block, you’ll see the toggle block in position but in a closed format. Click the arrow sign to expand it, place the title of your content in the “Panel Title” field, and subsequently, the main content in the “Panel Content” box. 

Place Title and Content

Now, if you are in need of more than one expandable or collapsible section, click the + button at the bottom of the block to insert a new toggle. Similarly, if you don’t want any specific toggle, click the x button at the end of the block. 

Add new toggles

Step 3: Customize the Content Toggle Block

Once you select the block, the block settings panel will appear on the right of your dashboard. There, you’ll find two separate tabs: General Settings and Styles.

In the General Settings tab, you can:

  • Adjust the Panel Title for proper hierarchy.
  • Set the toggle state to control whether the panels should be collapsed or open when the page loads.
  • Enable FAQ Schema to improve visibility in search engine results.
  • Use Responsive Control to hide or display the block on specific devices.
  • Add a Search Box for easy navigation of FAQs. However, this feature is limited to the Pro users. 
General Settings

Now, if you switch to the Styles Tab, you can adjust colors, enable borders, set toggle icon styles and positions, and fine-tune padding and margins.

Styles Tab

Once satisfied, click “Publish” or “Update” to make it live.

Final Demo

Method 2: Using the Expand Block

Step 1: Add the Expand Block

Navigate to your page or post where you want your collapsible/expandable content. Click the “+” icon again to add a new block, search for “Expand” and select it. 

Add the Expand Block

Step 2: Add Content to the Block

The block will provide two sections: one for visible content (shown initially) and another for hidden content (revealed when clicked). Add the content you want to stay visible in the first section above the “Show More” text. Place the rest of the content in the hidden section below the “Show More” text. 

Visible and hidden content

Click the + sign on each block, select your preferred block, and later add content to the blocks. You can customize the “Show More” and “Show Less” texts to fit your content or audience better. Simply click on the default texts and replace them with your desired labels.

Add content and customize texts

Step 3: Customize the Expand Block

The free version provides limited customization, including scroll settings, responsive control, and dimension adjustments in the Styles tab. But, if you upgrade to the pro version, you can choose a fade effect for minimized content (available in General Settings). You can also customize the button’s style, background color, border, and radius for a more polished look.

Customize the block

When satisfied with the result, click “Publish” or “Update” to save and display the changes on your site.

Final Demo

Conclusion

The purpose of this article is to guide you in creating collapsible and expandable content in WordPress, while maintaining a clean and easy-to-navigate layout. Ultimate Blocks allow you to achieve this without the need for coding and that too with simplicity in both usability and design. Understanding your audience’s needs is crucial, as it helps you implement collapsible content where it provides the most value and ensures everything works smoothly for an optimal browsing experience. Keep that in mind that small changes like these can transform how visitors interact with your site.



The Tableberg Team