# Hide Widget Titles That Start With "!"

> Lets you keep a descriptive widget title in the admin but hide it on the site, just by starting the title with an exclamation mark.

- Type: PHP
- Runs: Run everywhere
- Category: [Widgets](https://wpide.com/library/category/widgets/)
- Tags: widgets, titles, sidebar
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/hide-widget-titles-with-exclamation/

## Code

```php
add_filter( 'widget_title', function ( $title ) {
    return ( is_string( $title ) && 0 === strpos( $title, '!' ) ) ? '' : $title;
} );
```

## Notes

Example: a widget titled "!Newsletter form" shows no heading on the site.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide Widget Titles That Start With "!"" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
