WordPress at a glance

shortcode_exists() WP 1.0

Whether a registered shortcode exists named $tag

✈ 1 time = 0.000011s = very fast | 50000 times = 0.02s = speed of light | PHP 7.1.5, WP 4.8.2

No Hooks.


true/false. Whether the given shortcode exists.


shortcode_exists( $tag );
$tag(string) (required)
Shortcode tag to check.


  • Global. Array. $shortcode_tags List of shortcode tags and their callback hooks.


Since 3.6.0 Introduced.

Code of shortcode exists: wp-includes/shortcodes.php WP 5.4.2

function shortcode_exists( $tag ) {
	global $shortcode_tags;
	return array_key_exists( $tag, $shortcode_tags );

Related Functions

From tag: Conditional tags (all)

More from category: Shortcodes

No comments
        Log In . Register