Title: Hide Broken Shortcodes
Author: Scott Reilly
Published: <strong>5. Januara 2010.</strong>
Last modified: 6. Maja 2026.

---

Pretražite dodatke

![](https://ps.w.org/hide-broken-shortcodes/assets/banner-772x250.png?rev=829818)

![](https://ps.w.org/hide-broken-shortcodes/assets/icon-128x128.png?rev=975977)

# Hide Broken Shortcodes

 Od [Scott Reilly](https://profiles.wordpress.org/coffee2code/)

[Skini](https://downloads.wordpress.org/plugin/hide-broken-shortcodes.2.0.zip)

 * [Detalji](https://bs.wordpress.org/plugins/hide-broken-shortcodes/#description)
 * [Recenzije](https://bs.wordpress.org/plugins/hide-broken-shortcodes/#reviews)
 *  [Instalacija](https://bs.wordpress.org/plugins/hide-broken-shortcodes/#installation)
 * [Razvoj](https://bs.wordpress.org/plugins/hide-broken-shortcodes/#developers)

 [Podrška](https://wordpress.org/support/plugin/hide-broken-shortcodes/)

## Opis

By default in WordPress, if the plugin that provides the functionality to handle
any given shortcode is disabled, or if a shortcode is improperly defined in the 
content (such as with a typo), then the shortcode in question will appear on the
site in its entirety, unprocessed by WordPress. At best this reveals unsightly code-
like text to visitors and at worst can potentially expose information not intended
to be seen by visitors.

This plugin prevents unhandled shortcodes from appearing in the content of a post
or page. If the shortcode is of the self-closing variety, then the shortcode tag
and its attributes are not displayed and nothing is shown in their place. If the
shortcode is of the enclosing variety (an opening and closing tag bookend some text
or markup), then the text that is being enclosed will be shown, but the shortcode
tag and attributes that surround the text will not be displayed.

See the Filters section for more customization tips.

Links: [Plugin Homepage](https://coffee2code.com/wp-plugins/hide-broken-shortcodes/)
| [Plugin Directory Page](https://wordpress.org/plugins/hide-broken-shortcodes/)
| [GitHub](https://github.com/coffee2code/hide-broken-shortcodes/) | [Author Homepage](https://coffee2code.com)

### Developer Documentation

Developer documentation can be found in [DEVELOPER-DOCS.md](https://github.com/coffee2code/hide-broken-shortcodes/blob/master/DEVELOPER-DOCS.md).
That documentation covers the hooks provided by the plugin.

As an overview, these are the hooks provided by the plugin:

 * `hide_broken_shortcode` : Customizes what, if anything, gets displayed when a
   broken shortcode is encountered.
 * `hide_broken_shortcodes_filters` : Customizes what filters to hook to find text
   with potential broken shortcodes.

## Instalacija

 1. Install via the built-in WordPress plugin installer. Or install the plugin code
    inside the plugins directory for your site (typically `/wp-content/plugins/`).
 2. Activate the plugin through the ‘Plugins’ admin menu in WordPress
 3. Optionally filter ‘hide_broken_shortcode’ or ‘hide_broken_shortcodes_filters’ if
    you want to customize the behavior of the plugin

## ČPP

### Why am I still seeing a broken shortcode even with this plugin activated?

By default, the plugin only tries to hide broken shortcodes appearing in post/page
content, post/page excerpts, and widgets. It does not hide broken shortcodes that
may appear in post/page titles, custom fields, menus, comments, etc.

### How can I type out a shortcode in a post so that it doesn't get processed by WordPress or hidden by this plugin?

If you want want a shortcode to appear as-is in a post (for example, you are trying
to provide an example of how to use a shortcode), can use the shortcode escaping
syntax, which is built into WordPress, by using two opening brackets to start the
shortcode, and two closing brackets to close the shortcode:

 * `[[some_shortcode]]`
 * `[[an_example style="yes"]some text[/an_example]]`

The shortcodes will appear in your post (but without the double brackets).

### How can I prevent certain broken shortcodes from being hidden?

Assuming you want to allow the broken shortcodes ‘abc’ and ‘gallery’ to be ignored
by this plugin (and therefore not hidden if broken), you can include the following
in your theme's functions.php file or in a site-specific plugin:

    ```
    /**
     * Permit certain shortcodes to appear as broken without being hidden.
     *
     * @param string $display        The text to display in place of the broken shortcode.
     * @param string $shortcode_name The name of the shortcode.
     * @param array  $m              The regex match array for the shortcode.
     * @return string
     */
    function allowed_broken_shortcodes( $display, $shortcode_name, $m ) {
        $shortcodes_not_to_hide = array( 'abc', 'gallery' );
        if ( in_array( $shortcode_name, $shortcodes_not_to_hide ) ) {
            $display = $m[0];
        }
        return $display;
    }
    add_filter( 'hide_broken_shortcode', 'allowed_broken_shortcodes', 10, 3 );
    ```

### Does this plugin have unit tests?

Yes. The tests are not packaged in the release .zip file or included in plugins.
svn.wordpress.org, but can be found in the [plugin's GitHub repository](https://github.com/coffee2code/hide-broken-shortcodes/).

## Recenzije

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

### 󠀁[Useful Tool – 5-Stars!!!](https://wordpress.org/support/topic/useful-tool-5-stars/)󠁿

 [Jimmy Lee](https://profiles.wordpress.org/shirtguy72/) 23. Maja 2023.

VERY Useful Tool – 5-Stars!!! Working fine, THANKS!

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

### 󠀁[Excellent](https://wordpress.org/support/topic/excellent-12467/)󠁿

 [nemausus30](https://profiles.wordpress.org/nemausus30/) 18. Januara 2023.

Super !

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

### 󠀁[For me it works](https://wordpress.org/support/topic/for-me-it-works/)󠁿

 [sob2](https://profiles.wordpress.org/sob2/) 27. Juna 2022.

Does the job, nice.

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

### 󠀁[Works Great!](https://wordpress.org/support/topic/works-great-5470/)󠁿

 [Morshed Alam](https://profiles.wordpress.org/sumon1068/) 25. Decembra 2018.

This plugin does what it says. Really a great plugin. Thank you developer.

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

### 󠀁[It doesnt work](https://wordpress.org/support/topic/it-doesnt-work-173/)󠁿

 [zakisp](https://profiles.wordpress.org/zakisp/) 3. Marta 2018.

I installed the plugin but shortcode is still appearing The shortcode is a qtranslate
language string documentation can be improved and maybe you can add troubleshooting
section in the documentation or the reason why it might not work

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

### 󠀁[Nice](https://wordpress.org/support/topic/nice-2112/)󠁿

 [mstoneman](https://profiles.wordpress.org/mstoneman/) 22. Juna 2017.

Not flashy. Does one thing and does it right. If shortcode isn't working, readers
can't see it.

 [ Read all 10 reviews ](https://wordpress.org/support/plugin/hide-broken-shortcodes/reviews/)

## Saradnici i programeri

“Hide Broken Shortcodes” is open source software. The following people have contributed
to this plugin.

Doprinositelji

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)

“Hide Broken Shortcodes” je prijeveden na 2 dijalekta. Zahvala [prevodiocima](https://translate.wordpress.org/projects/wp-plugins/hide-broken-shortcodes/contributors)
za njihov doprinos.

[Prevedi “Hide Broken Shortcodes” na vaš jezik.](https://translate.wordpress.org/projects/wp-plugins/hide-broken-shortcodes)

### Zainteresirani za razvoj?

[Pregledajte kôd](https://plugins.trac.wordpress.org/browser/hide-broken-shortcodes/),
pogledajte [SVN spremište](https://plugins.svn.wordpress.org/hide-broken-shortcodes/)
ili se pretplatite na [dnevnik razvoja](https://plugins.trac.wordpress.org/log/hide-broken-shortcodes/)
od [RSS](https://plugins.trac.wordpress.org/log/hide-broken-shortcodes/?limit=100&mode=stop_on_copy&format=rss).

## Zapis promijena

#### 2.0 (2025-10-31)

 * Change: Discontinue unnecessary explicit loading of textdomain
 * Change: Merge `register_filters()` into `init()`
 * Change: Improve documentation for provided filters
 * Change: Note compatibility through WP 6.8+
 * Change: Note compatibility through PHP 8.3+
 * Change: Update copyright date (2025)
 * Change: Remove development and testing-related files from release packaging
 * Change: Reduce number of ‘Tags’ from `readme.txt`

#### 1.9.4 (2021-10-09)

 * New: Add DEVELOPER-DOCS.md and move hooks documentation into it
 * Change: Note compatibility through WP 5.8+
 * Change: Tweak installation instruction
 * Change: Tweak TODO entry
 * Unit tests:
    - Change: Restructure unit test directories
       * Change: Move `phpunit/` into `tests/`
       * Change: Move `phpunit/bin` into `tests/`
    - Change: Remove ‘test-‘ prefix from unit test file
    - Change: In bootstrap, store path to plugin file constant
    - Change: In bootstrap, add backcompat for PHPUnit pre-v6.0

#### 1.9.3 (2021-04-18)

 * Change: Note compatibility through WP 5.7+
 * Change: Update copyright date (2021)

_Full changelog is available in [CHANGELOG.md](https://github.com/coffee2code/hide-broken-shortcodes/blob/master/CHANGELOG.md)._

## Meta

 *  Version **2.0**
 *  Last updated **prije 2 mjeseca**
 *  Active installations **400+**
 *  WordPress version ** 2.5 ili viša **
 *  Tested up to **6.8.5**
 *  Languages
 * [English (US)](https://wordpress.org/plugins/hide-broken-shortcodes/), [German](https://de.wordpress.org/plugins/hide-broken-shortcodes/)
   i [Swedish](https://sv.wordpress.org/plugins/hide-broken-shortcodes/).
 *  [Prevedite na vaš jezik](https://translate.wordpress.org/projects/wp-plugins/hide-broken-shortcodes)
 * Tags
 * [coffee2code](https://bs.wordpress.org/plugins/tags/coffee2code/)[content](https://bs.wordpress.org/plugins/tags/content/)
   [post](https://bs.wordpress.org/plugins/tags/post/)[shortcode](https://bs.wordpress.org/plugins/tags/shortcode/)
   [shortcodes](https://bs.wordpress.org/plugins/tags/shortcodes/)
 *  [Napredni pogled](https://bs.wordpress.org/plugins/hide-broken-shortcodes/advanced/)

## Ocjene

 4.5 out of 5 stars.

 *  [  8 5-star reviews     ](https://wordpress.org/support/plugin/hide-broken-shortcodes/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/hide-broken-shortcodes/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/hide-broken-shortcodes/reviews/?filter=3)
 *  [  1 2-star review     ](https://wordpress.org/support/plugin/hide-broken-shortcodes/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/hide-broken-shortcodes/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/hide-broken-shortcodes/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/hide-broken-shortcodes/reviews/)

## Doprinositelji

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)

## Podrška

Imate nešto za reći? Trebate pomoć?

 [Pogledaj forum podrške](https://wordpress.org/support/plugin/hide-broken-shortcodes/)

## Pokloni

Da li bi ste željeli da podržite napredovanje ovog proširenja?

 [ Pokloni ovom proširenju ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6ARCFJ9TX3522)