WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Lester Chan v3.0.0

WP-ShowHide

Allows you to embed content within your blog post via WordPress ShortCode API and toggling the visibility of the content via a button.

WP-ShowHide

The facts

Rating
4.2★ from 43
Active installs
9k+
Price
Free
Last updated
9 Aug 2026
Added
Apr 2011
Requires WP
6.8
Tested up to
WP 7.0.4
Requires PHP
8.2
Downloads
151,742

Our analysis

AI-assisted

WP-ShowHide is a WordPress plugin that allows you to hide parts of your posts behind a toggle button. This is useful for lengthy content such as press releases or spoilers, enabling readers to choose whether to view the hidden text. The plugin uses a shortcode, [showhide], which can be implemented multiple times in a single post or page.

The plugin includes a Show/Hide block for the block editor, allowing you to manage hidden content as regular blocks. It features a button that indicates how many words are hidden, supports keyboard navigation, and is accessible for screen readers. There are no configuration options or settings screens, making it straightforward to use for anyone looking to manage content visibility on their site.

Best for: This plugin suits bloggers and website owners who want to manage lengthy content visibility.

What it does well

  • Free to use from the WordPress.org directory
  • Easy to implement with a simple shortcode
  • Includes a block for the Gutenberg editor
  • Accessible features for keyboard and screen reader users
  • No additional scripts required if not using the shortcode

Where it falls short

  • Limited information available on additional features or customisation options

Verdict

WP-ShowHide provides a simple solution for hiding content in WordPress posts, making it suitable for users needing to streamline their pages. Its ease of use and accessibility features are notable advantages.

From the developer

Lester Chan's own description of WP-ShowHide, lightly tidied.

WP-ShowHide hides part of a post behind a button, so something long — a press release, a changelog, a spoiler — does not fill the page until a reader asks for it. The button says how many words it is hiding, which is what Engadget does with their press releases. Example usage: [showhide type="pressrelease"]Press Release goes in here.[/showhide]

There is nothing to configure and no settings screen. Every choice the plugin offers is an attribute of the shortcode that makes it, so two toggles in the same post can behave differently.

Features

  • One shortcode, [showhide], usable any number of times in a post or page
  • A Show/Hide block for the block editor, holding the content it hides as ordinary blocks and rendering exactly what the shortcode renders
  • A button rather than a link, with aria-expanded and aria-controls, so the toggle works from the keyboard and reads correctly to a screen reader
  • Labels that count the words they are hiding
  • No jQuery, and no script at all on a page that uses neither the shortcode nor the block
  • Custom DOM events on every toggle, for themes that want to react to one

Donations

I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.

Usage

  1. By default, content within the showhide shortcode will be hidden.
  2. Example: [showhide]Press release content goes in here.[/showhide]
  3. Default Values: [showhide type="pressrelease" more_text="Show Press Release (%s More Words)" less_text="Hide Press Release (%s Less Words)" hidden="yes"]

  4. You can have multiple showhide content within a post or a page, just by having a new type.

  5. Example: [showhide type="links" more_text="Show Links (%s More Words)" less_text="Hide Links (%s Less Words)"]Links will go in here.[/showhide]

  6. If you want to set the default visibility to display.

  7. Example: [showhide hidden="no"]Press release content goes in here.[/showhide]

Block editor

There is a Show/Hide block too, filed under Text in the inserter. It holds the content it hides as ordinary blocks — paragraphs, images, anything — so that content is written and edited in place instead of being typed into a field as markup, and it stays visible while you are editing. The Show/Hide panel in the sidebar carries the same four choices the shortcode attributes carry: the type, the two button labels, and whether it starts hidden.

The shortcode is unchanged and still supported. It is not deprecated, posts that use it need no editing, the block and the shortcode render the same markup, and one post can hold both.

  1. You can style the content via CSS that is generated by the plugin. Here is a sample of the generated HTML. Note that pressrelease is the default type.
<div id="pressrelease-link-1" class="wp-showhide sh-link pressrelease-link sh-hide">
  <button type="button" class="sh-toggle" aria-expanded="false" aria-controls="pressrelease-content-1"
          data-sh-more="Show Press Release (4 More Words)"
          data-sh-less="Hide Press Release (4 Less Words)">Show Press Release (4 More Words)</button>
</div>
<div id="pressrelease-content-1" class="wp-showhide sh-content pressrelease-content sh-hide" hidden>Content</div>
  1. With the example above, here are the following styles you can use in your CSS:
.sh-link { }  
.sh-toggle { }  
.sh-content { }  
.pressrelease-link { }  
.pressrelease-link.sh-hide .sh-toggle { }  
.pressrelease-link.sh-show .sh-toggle { }  
.pressrelease-content { }  
.pressrelease-content.sh-hide { }  
.pressrelease-content.sh-show { }
  1. Every toggle fires three events on the .sh-link element, and all three bubble, so one listener on the document covers every toggle on the page: sh-link:more when a toggle opens, sh-link:less when it closes, and sh-link:toggle on both.

Read the full description on the official page →

Tagged as