How to Show and Hide Text in WordPress Posts in 2023: An In-Depth Guide

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:

PluginRatingsKey Features
WP Hide Content4.8 starsShortcodes, 3 styles, customizable
Smart Toggle Content5 starsAutomatic toggling, widget support
Toggle Show Content4.1 starsShortcode 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":

Install plugin screenshot

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:

Plugin settings screenshot

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:

WP Hide Content 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:

Adding a toggle block screenshot

Step 2: Edit Block Content

The toggle block has two areas – Add summary title voters click to expand content. Then insert hidden content underneath:

Editing a toggle block screenshot

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 MethodBlock Editor Method
✅ ProsMore customization optionsNo plugins required
❌ ConsRequires installing pluginsLimited 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.

We will be happy to hear your thoughts

      Leave a reply

      TechUseful