# List All Registered Shortcodes Under Tools

> Adds a Tools > Shortcodes screen listing every shortcode available on the site and the plugin, theme or function that provides it, so you know what can be used in content.

- Type: PHP
- Runs: Admin only
- Category: [Developer](https://wpide.com/library/category/developer/)
- Tags: shortcodes, debugging, tools
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/debug-shortcodes-list-page/

## Code

```php
add_action( 'admin_menu', function () {
    add_management_page( 'Shortcodes', 'Shortcodes', 'manage_options', 'wpide-shortcodes', function () {
        global $shortcode_tags;

        $source = function ( $callback ) {
            try {
                if ( is_string( $callback ) && false !== strpos( $callback, '::' ) ) {
                    $callback = explode( '::', $callback );
                }
                $reflection = is_array( $callback ) ? new ReflectionMethod( $callback[0], $callback[1] ) : new ReflectionFunction( $callback );
                $file       = (string) $reflection->getFileName();
            } catch ( ReflectionException $e ) {
                return '';
            }
            if ( false !== strpos( $file, WP_PLUGIN_DIR ) ) {
                return 'Plugin: ' . strtok( str_replace( WP_PLUGIN_DIR . '/', '', $file ), '/' );
            }
            if ( false !== strpos( $file, get_theme_root() ) ) {
                return 'Theme: ' . strtok( str_replace( get_theme_root() . '/', '', $file ), '/' );
            }
            return false !== strpos( $file, ABSPATH . WPINC ) ? 'WordPress' : str_replace( ABSPATH, '', $file );
        };

        $tags = $shortcode_tags;
        ksort( $tags );

        echo '<div class="wrap"><h1>Shortcodes (' . count( $tags ) . ')</h1><table class="widefat striped"><thead><tr><th>Shortcode</th><th>Provided by</th></tr></thead><tbody>';
        foreach ( $tags as $tag => $callback ) {
            printf( '<tr><td><code>[%s]</code></td><td>%s</td></tr>', esc_html( $tag ), esc_html( $source( $callback ) ) );
        }
        echo '</tbody></table></div>';
    } );
} );
```

## Notes

Shortcodes registered only on the front end will not appear here.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "List All Registered Shortcodes Under Tools" 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/
