67

How to Get a List of All Loaded Shortcodes in WordPress

Powered by WPCodeBox

This WordPress snippet helps you easily list all loaded shortcodes. Run it in manual mode and view the output in the editor’s output pane.


<?php

// This snippet should run in "Manual mode"

global $shortcode_tags;

ksort( $shortcode_tags );
 
$shortcode_output = "<ul>";
 
foreach ( $shortcode_tags as $shortcode => $value ) {
    $shortcode_output = $shortcode_output . '<li>[' . $shortcode . ']</li>';
}
 
$shortcode_output = $shortcode_output . "</ul>";

echo "All the loaded shortcodes are: <br/>===================== <br/>";
echo $shortcode_output;

Other Snippets

WPCodeBox is a WordPress Code Snippets Manager that allows you to share your WordPress Code Snippets across your sites.