Title: WP-ShowHide
Author: Lester Chan
Published: <strong>April 28, 2011</strong>
Last modified: August 9, 2026

---

Search plugins

![](https://ps.w.org/wp-showhide/assets/banner-772x250.jpg?rev=1206767)

![](https://ps.w.org/wp-showhide/assets/icon.svg?rev=978037)

# WP-ShowHide

 By [Lester Chan](https://profiles.wordpress.org/gamerz/)

[Download](https://downloads.wordpress.org/plugin/wp-showhide.3.0.0.zip)

 * [Details](https://mlt.wordpress.org/plugins/wp-showhide/#description)
 * [Reviews](https://mlt.wordpress.org/plugins/wp-showhide/#reviews)
 *  [Installation](https://mlt.wordpress.org/plugins/wp-showhide/#installation)
 * [Development](https://mlt.wordpress.org/plugins/wp-showhide/#developers)

 [Support](https://wordpress.org/support/plugin/wp-showhide/)

## Description

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.

## Screenshots

[⌊Four toggles on one page, three of them closed: the default, one that starts open,
and two more whose ids do not collide⌉⌊Four toggles on one page, three of them closed:
the default, one that starts open, and two more whose ids do not collide⌉[

Four toggles on one page, three of them closed: the default, one that starts open,
and two more whose ids do not collide

[⌊The same page with a toggle opened⌉⌊The same page with a toggle opened⌉[

The same page with a toggle opened

[⌊The Show/Hide block in the editor, holding the content it hides as ordinary blocks
so it stays editable, with the sidebar carrying the same choices the shortcode attributes
carry⌉⌊The Show/Hide block in the editor, holding the content it hides as ordinary
blocks so it stays editable, with the sidebar carrying the same choices the shortcode
attributes carry⌉[

The Show/Hide block in the editor, holding the content it hides as ordinary blocks
so it stays editable, with the sidebar carrying the same choices the shortcode attributes
carry

## Blocks

This plugin provides 1 block.

 *   Show/Hide Hides its content behind a button that counts the words it is hiding.

## Installation

 1. Install and activate the plugin.
 2. Wrap the content you want hidden in `[showhide]` and `[/showhide]`, or add the **
    Show/Hide** block in the editor and put the content inside it.

There is nothing to configure and no settings screen. Every choice the plugin offers
is an attribute of the shortcode or a control in the block’s sidebar, so two toggles
in the same post can behave differently.

## FAQ

### How do I change the button text?

Pass `more_text` and `less_text` on the shortcode. `%s` in either one is replaced
with the number of words being hidden, and a label with no `%s` in it is used exactly
as written.

### Can I drop the plugin’s stylesheet?

Yes. It is two rules and it is enqueued under the handle `wp-showhide`, so dequeue
it from your theme:

    ```
    add_action( 'wp_enqueue_scripts', function () {
        wp_dequeue_style( 'wp-showhide' );
    }, 20 );
    ```

The toggle keeps working; the button will simply look like your theme’s buttons 
instead of like a text link.

### Why did the same type give me duplicate IDs?

It no longer does. Since 2.0.0 the first toggle of a given type in a post keeps 
the ID it has always had and later ones are suffixed `-2`, `-3` and so on. Style
by class rather than by ID if you use the same type more than once.

### Does the plugin store anything in my database?

One row, and it is tiny. `wp_showhide_version` records the version last run so that
an upgrade knows what it is upgrading from. There is no settings row, because there
are no settings. Deleting the plugin from the Plugins screen removes the row, on
a single site and on every site of a network.

## Reviews

![](https://secure.gravatar.com/avatar/3060dfb3ebc69b2721b61c6c9b257b572740c78d796374d7b750fbb49411dffe?
s=60&d=retro&r=g)

### 󠀁[Works great with WP 6.8.1](https://wordpress.org/support/topic/works-great-with-wp-6-8-1/)󠁿

 [Dave Smith](https://profiles.wordpress.org/sophoservices/) July 3, 2025

Shows and hides text just like it says it does! Thank you!

![](https://secure.gravatar.com/avatar/5112f2f6b6ebee0e8f4e64a6a8d7c9c0d9c36e41a96b96b2c8d0a4a8113d3b52?
s=60&d=retro&r=g)

### 󠀁[Needs Update](https://wordpress.org/support/topic/needs-update-29/)󠁿

 [vivatword](https://profiles.wordpress.org/vivatword/) April 13, 2025

Thanks for the free plugin and support. it doesn’t work woth the latest wp. the 
hided side can not be seen after click the show. it is only active when logged in
to wp-admin. please update it.

![](https://secure.gravatar.com/avatar/da4bab7747b735b8fb94a85a4711fa143a38a46f12bd45f431f2ce6102ec16d9?
s=60&d=retro&r=g)

### 󠀁[Needs documentation](https://wordpress.org/support/topic/needs-documentation-5/)󠁿

 [delboy007](https://profiles.wordpress.org/delboy007/) February 9, 2022

I don’t understand why developers take the time to write a plugin and then don’t
bother to provide detailed documentation. Looks like it might do what I want but
I give up trying and notice a lot of support requests have not been replied to.

![](https://secure.gravatar.com/avatar/0f506eb13b5c750220d42b3746eb21ab8dbb832ec4e625b2c581f03e7f85643e?
s=60&d=retro&r=g)

### 󠀁[Great plugin](https://wordpress.org/support/topic/great-plugin-29543/)󠁿

 [Rollaz](https://profiles.wordpress.org/rollaz/) January 30, 2021

Simple and working plugin. Tried several more, but they had issues with filter Im
using on my page, this one worked like a charm. Additionally I would recommend to
add an option to show hide button on the bottom of displayed text.

![](https://secure.gravatar.com/avatar/b9e6852002036e802ef36d83dae57bf39ce624a523869e293f723b5ba3d78c07?
s=60&d=retro&r=g)

### 󠀁[WP ShowHide is a great plugin,](https://wordpress.org/support/topic/wp-showhide-is-a-great-plugin/)󠁿

 [thetravelgal](https://profiles.wordpress.org/thetravelgal/) December 23, 2020 
1 reply

Love this plugin. Had a little panic that it wasn’t going to work with Wordpress
5.6 and php 7.4, but it does. Please keep maintaining this plugin! (I just sent 
my donation.)

![](https://secure.gravatar.com/avatar/3956b3259e2b02d5d5dffd9286cb4c19b90899c1b3d149c223c12ddcc73888ea?
s=60&d=retro&r=g)

### 󠀁[great idea but doesn’t work](https://wordpress.org/support/topic/great-idea-but-doesnt-work-6/)󠁿

 [pentagramwookie](https://profiles.wordpress.org/pentagramwookie/) September 20,
2020

It’s a great idea and could be very useful but it doesn’t work on the current WP
version. The site I was trying to use this on uses WP 5.5.1, with plugins Akismet,
Feed Them Social, Feedzy, and Lightbox. I figure this plugin may be incompatible
with one of those plugins or this current version of WP. The link doesn’t do anything
when clicked and the wrong text is showing up. Even though I changed the shortcode
to say ‘MORE INFO’ it still said Press Release along with the additional number 
text and a number next to it. I didn’t see settings anywhere for this plugin.

 [ Read all 42 reviews ](https://wordpress.org/support/plugin/wp-showhide/reviews/)

## Contributors & Developers

“WP-ShowHide” is open source software. The following people have contributed to 
this plugin.

Contributors

 *   [ Lester Chan ](https://profiles.wordpress.org/gamerz/)

“WP-ShowHide” has been translated into 5 locales. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/wp-showhide/contributors)
for their contributions.

[Translate “WP-ShowHide” into your language.](https://translate.wordpress.org/projects/wp-plugins/wp-showhide)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/wp-showhide/), check
out the [SVN repository](https://plugins.svn.wordpress.org/wp-showhide/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/wp-showhide/) by
[RSS](https://plugins.trac.wordpress.org/log/wp-showhide/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

### 3.0.0

 * BREAKING: Requires WordPress 6.8 and PHP 8.2, up from 6.0 and 7.4.
 * BREAKING: Removed the `showhide_scripts()`, `showhide_js()` and `showhide_shortcode()`
   global functions. They were internals; the plugin registers its own shortcode
   and assets.
 * BREAKING: The `ShowHide` and `ShowHide_Template` classes are now `WP_ShowHide`
   and `WP_ShowHide_Template`.
 * NEW: Added a Show/Hide block for the block editor, which holds the content it
   hides as ordinary blocks. The `[showhide]` shortcode is unchanged and still supported—
   it is not deprecated, posts using it need no editing, and the two render the 
   same markup.
 * NEW: Restructured into `includes/`, behind the `WP_ShowHide`, `WP_ShowHide_Template`
   and `WP_ShowHide_Options` classes.
 * NEW: Added the `wp_showhide_version` row, and an `uninstall.php` that deletes
   it on a single site and across a network.
 * NEW: The toggle script and the stylesheet are now files, `js/wp-showhide.js` 
   and `css/wp-showhide.css`, so a browser caches them once instead of reading them
   inline on every page.
 * NEW: Added a PHPUnit and vitest test suite, and GitHub Actions CI.
 * CHANGED: Both elements the shortcode renders now carry a `wp-showhide` class 
   alongside the classes they have always had. Nothing was renamed or removed, so
   existing theme CSS is unaffected.
 * FIXED: `hidden="No"` left the content collapsed instead of expanding it. The 
   attribute is matched case insensitively now, so any spelling of `no` works.
 * FIXED: Requesting `wp-showhide.php` directly ran it outside WordPress instead
   of exiting.

## Meta

 *  Version **3.0.0**
 *  Last updated **1 hour ago**
 *  Active installations **9,000+**
 *  WordPress version ** 6.8 or higher **
 *  Tested up to **7.0.3**
 *  PHP version ** 8.2 or higher **
 *  Languages
 * [Dutch](https://nl.wordpress.org/plugins/wp-showhide/), [English (UK)](https://en-gb.wordpress.org/plugins/wp-showhide/),
   [English (US)](https://wordpress.org/plugins/wp-showhide/), [German](https://de.wordpress.org/plugins/wp-showhide/),
   [Spanish (Chile)](https://cl.wordpress.org/plugins/wp-showhide/), and [Spanish (Spain)](https://es.wordpress.org/plugins/wp-showhide/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/wp-showhide)
 * Tags
 * [hide](https://mlt.wordpress.org/plugins/tags/hide/)[press release](https://mlt.wordpress.org/plugins/tags/press-release/)
   [show](https://mlt.wordpress.org/plugins/tags/show/)[toggle](https://mlt.wordpress.org/plugins/tags/toggle/)
   [visibility](https://mlt.wordpress.org/plugins/tags/visibility/)
 *  [Advanced View](https://mlt.wordpress.org/plugins/wp-showhide/advanced/)

## Ratings

 4.2 out of 5 stars.

 *  [  30 5-star reviews     ](https://wordpress.org/support/plugin/wp-showhide/reviews/?filter=5)
 *  [  4 4-star reviews     ](https://wordpress.org/support/plugin/wp-showhide/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/wp-showhide/reviews/?filter=3)
 *  [  4 2-star reviews     ](https://wordpress.org/support/plugin/wp-showhide/reviews/?filter=2)
 *  [  5 1-star reviews     ](https://wordpress.org/support/plugin/wp-showhide/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-showhide/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/wp-showhide/reviews/)

## Contributors

 *   [ Lester Chan ](https://profiles.wordpress.org/gamerz/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/wp-showhide/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://lesterchan.net/site/donation/)