Title: strip_shortcode_tag
Published: April 25, 2014
Last modified: August 20, 2026

---

# strip_shortcode_tag( array $m ): string|false

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/strip_shortcode_tag/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/strip_shortcode_tag/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/strip_shortcode_tag/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/functions/strip_shortcode_tag/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/strip_shortcode_tag/?output_format=md#wp--skip-link--target)

Strips a shortcode tag based on RegEx matches against post content.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/strip_shortcode_tag/?output_format=md#parameters)󠁿

 `$m`arrayrequired

RegEx matches against post content.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/strip_shortcode_tag/?output_format=md#return)󠁿

 string|false The content stripped of the tag, otherwise false.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/strip_shortcode_tag/?output_format=md#source)󠁿

    ```php
    function strip_shortcode_tag( $m ) {
    	// Allow [[foo]] syntax for escaping a tag.
    	if ( '[' === $m[1] && ']' === $m[6] ) {
    		return substr( $m[0], 1, -1 );
    	}

    	return $m[1] . $m[6];
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/shortcodes.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/shortcodes.php#L757)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/shortcodes.php#L757-L764)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/strip_shortcode_tag/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fstrip_shortcode_tag%2F)
before being able to contribute a note or feedback.