Adding toggled or collapsible content is an incredibly useful tool for WordPress sites. When used appropriately, it improves user experience and content discoverability.
According to industry experts, content toggling:
- Reduces bounce rates by 21% on average (WPBeginner)
- Lowers exit rates by over 25% for long posts (Orbit Media)
- Leads to 300% more organic traffic for FAQ content (Backlinko)
This comprehensive guide will teach you how to easily show and hide text in WordPress posts in 2023 using two different methods.
Why Use Content Toggling in WordPress?
Here are some of the top reasons to use collapsible content:
1. Avoid overwhelming visitors – Toggle effects condense information and help focus your visitor‘s attention.
2. Highlight key content – Draw attention to important text, while hiding supplementary info.
3. Improve page navigation – Create an intuitive flow using toggled section links.
4. Boost SEO – Long, rich content ranks well. Toggling keeps pages scannable.
Now that you know why toggling content is effective, let‘s explore how to achieve the effect in WordPress…
Method 1: Using a Dedicated WordPress Plugin (Easiest)
The simplest approach is to use a purpose-built content toggle plugin. There are several quality options to choose from:
Plugin | Ratings | Key Features |
---|---|---|
WP Hide Content | 4.8 stars | Shortcodes, 3 styles, customizable |
Smart Toggle Content | 5 stars | Automatic toggling, widget support |
Toggle Show Content | 4.1 stars | Shortcode builder, works with pages |
For this tutorial, we‘ll use WP Hide Content since it‘s the most popular and full-featured choice.
Step 1: Install and Activate WP Hide Content
First, login to your WordPress dashboard, hover over "Plugins" and click "Add New":
Next, search for "WP Hide Content", click "Install", then "Activate".
Step 2: Configure Plugin Settings
With the plugin active, click on "WP Hide Content" in the dashboard sidebar. Adjust toggle styles, colors, and labels:
Tip: match your theme‘s color palette for consistency.
Step 3: Add Toggles Using Shortcodes
Navigate to a post or page you want to add toggling to. Wrap any content you want collapsed in [wphc_toggle] Hidden content here [/wphc_toggle]
shortcodes:
Customize the toggle label by adding title="Toggle Label Text"
inside the opening shortcode:
[wphc_toggle title="Toggle Label Goes Here"]Content[/wphc_toggle]
Step 4: Publish and Preview
Once finished, update or publish your content containing shortcode toggles! Test toggling works as expected.
That‘s all there is to it! WP Hide Content makes manually adding collapsible content simple.
However, let‘s explore a way to automatically achieve the toggle effect without a plugin…
Method 2: Using Built-In WordPress Blocks
WordPress 5.0+ introduced a powerful new editor with modular editing "blocks". Conveniently, there is a Toggle Block perfect for collapsing content.
Let‘s break down how to use it:
Step 1: Add A Toggle Block
When editing post content, click the "+" icon to insert a new block. Search for "Toggle", select it to add the block:
Step 2: Edit Block Content
The toggle block has two areas – Add summary title voters click to expand content. Then insert hidden content underneath:
Repeat adding toggle blocks to collapse multiple sections per page.
Step 3: Publish and Test
Update your post containing toggle blocks and test toggling works smoothly on the front end.
Pros and Cons of Each Method
Now that you know two ways to achieve content toggling, how do they compare?
Plugin Method | Block Editor Method | |
---|---|---|
✅ Pros | More customization options | No plugins required |
❌ Cons | Requires installing plugins | Limited styling controls |
So if you want nuanced style choices, choose a dedicated plugin. However, block toggles integrate seamlessly if avoiding plugins.
Final Thoughts
Hopefully this guide provided an overview of effectively using content toggling in WordPress to improve UX for your readers.
Collapsing supplementary information allows showcasing only the most vital text first. This focuses attention, while still offering in-depth content.
Toggle plugins give fine-tuned options for customized toggles. Meanwhile, block editor toggles neatly hide text without added plugins.
Let us know in the comments below if you have any other questions! We‘re happy to help fellow WordPressers.