Do Plugins Have Shortcodes in WordPress?
Yes, many plugins add shortcodes. How to find them: plugin docs, add_shortcode in the source, or a WP-CLI list of registered tags. Checked on WordPress 7.1.4.

Yes. Many WordPress plugins add their own shortcodes, the bracketed tags such as [contact-form-7 id="1a2b3c4" title="Contact form 1"] or [woocommerce_cart] that you paste into a post or page to show a form, a cart or a product grid. Not every plugin has one, though, and plenty of newer plugins ship blocks only. The quickest way to find out is the plugin’s documentation or settings screen; the definitive way is to list what the plugin registered on your own site, which takes one WP-CLI command.
Our team checked every function, filter and command in this guide against the WordPress 7.1.4 source code (the current release) on 18 November 2026, and read the shortcode registrations in the current versions of Contact Form 7, Yoast SEO and WooCommerce from their official plugin downloads.
This page has no recorded Search Console queries yet, so the headings below follow the questions site owners and developers ask when they meet a shortcode they do not recognise.
Do plugins have shortcodes in WordPress?
Plugins do, and so does WordPress itself. The Shortcode API arrived in WordPress 2.5, and it lets any plugin or theme register a tag together with a PHP function. When WordPress finds that tag in your content, it calls the function and swaps the tag for whatever HTML the function returns.
The registration is a single line of code. A plugin calls add_shortcode() with a tag name and a callback, and WordPress stores the pair in a global array called $shortcode_tags. On the front end, WordPress runs do_shortcode() on post content through the the_content filter at priority 11, just after automatic paragraphs are added, which is why a shortcode can sit in the middle of normal text.
Whether a given plugin offers shortcodes depends on what it does. Plugins that put something visible inside your content (forms, galleries, sliders, product lists, breadcrumbs, pricing tables) usually do. Plugins that work in the background (caching, security, backups, SEO meta tags) usually do not, because there is nothing for a visitor to see in the middle of a post.
Here is what three of the most installed plugins register, read straight from their source code on 18 November 2026:
Plugin (version checked) | Shortcodes it registers | Notes |
|---|---|---|
Contact Form 7 6.2.5 |
| Each form gets its own shortcode with a short hash id and a title, shown on the Contact, then Contact Forms screen. |
Yoast SEO 28.8 |
| Prints the breadcrumb trail; Yoast also offers a breadcrumbs block and a PHP function for themes. |
WooCommerce 11.3.0 | More than 20, including | Each core tag name passes through a filter, so a site can rename it; new stores use blocks for cart and checkout by default. |
WooCommerce is a good example of why the documentation is not always the full story. Its shipping code registers a [fee] shortcode only for the moment it calculates a flat rate cost, so you will never use it in a post and it will not appear in most lists of registered tags.
What is a WordPress shortcode, exactly?
A shortcode is a placeholder. You type a tag in square brackets, and at display time WordPress replaces it with real output. There are two shapes:
- Self-closing:
[gallery ids="12,15,18" columns="3"]. The attributes inside the brackets tell the callback what to show. - Enclosing:
[caption]<img ...> A photo caption[/caption]. Everything between the opening and closing tag is passed to the callback as content it can wrap or change.
Attributes are optional, and the plugin decides which ones it accepts and what the defaults are, normally through the core helper shortcode_atts(). Unknown attributes are dropped quietly, which is why a typo in an attribute name rarely causes an error; the shortcode simply ignores it.
Two small details trip people up. A tag name cannot contain spaces or the characters & / < > [ ] =; WordPress 7.1.4 refuses to register such a name and logs a “doing it wrong” notice instead. And if you want to show a shortcode as text in a tutorial without running it, wrap it in double brackets: [[gallery]] prints [gallery] on the page.
Which shortcodes come with WordPress itself?
Before you blame a plugin for a tag you do not recognise, check whether core owns it. WordPress 7.1.4 registers these shortcodes out of the box:
Shortcode | What it does |
|---|---|
| Shows a grid of images from the media library. |
| Wraps an image with a caption; the classic editor writes this for captioned images. |
| Embeds an audio player for an uploaded file or URL. |
| Embeds a video player for an uploaded file or URL. |
| Shows an audio or video playlist from attached media. |
| Turns a supported URL (YouTube, for example) into an embedded player. |
These come from wp-includes/media.php and the embed class. Older posts written in the classic editor are full of [caption] tags, and they keep working in the block editor because core still registers them. If you are moving videos around, our guide to embedding a YouTube video in WordPress covers the Embed block and the [embed] route side by side.
How do I find out which shortcodes a plugin has?
Work through these in order. The first two take a minute and answer most questions; the last two give you a certain answer even when the plugin has no documentation at all.
1. Read the plugin’s documentation
Open the plugin’s page on WordPress.org and look at the Description, FAQ and “Installation” tabs, then check the developer’s own docs. Well-maintained plugins list every shortcode with its attributes. WooCommerce, for example, keeps a shortcodes reference with every attribute and its default value.
2. Look inside the plugin’s admin screens
Many plugins print the shortcode next to the thing it displays. Contact Form 7 shows a ready-to-copy shortcode for each form on its forms list and edit screen. Gallery, slider and table plugins usually do the same, often with a copy button. Some plugins also add a button to the classic editor toolbar or a panel in the block inserter that writes the shortcode for you.
3. Search the plugin’s code for the registration call
Every shortcode is registered with add_shortcode(), so searching the plugin folder for that function name finds them all. On a server or a local copy, run this from the WordPress root (checked on 18 November 2026):
grep -rn "add_shortcode" wp-content/plugins/contact-form-7/For Contact Form 7 6.2.5 this returns two lines in load.php, one for contact-form-7 and one for contact-form. Read the callback named in each line to see which attributes it accepts. One warning: some plugins build tag names in a loop or pass them through a filter, as WooCommerce does, so the literal tag may not appear next to the function call. When that happens, the next method is more reliable.
4. Ask WordPress for its live list
The $shortcode_tags global holds every shortcode registered on the current request. With WP-CLI you can print just the names in one command:
wp eval 'global $shortcode_tags; echo implode( "\n", array_keys( $shortcode_tags ) ), "\n";'That tells you what exists, but not which plugin owns each tag. The next section fixes that.
How can I list every shortcode registered on my site?
Save this file as list-shortcodes.php anywhere outside your web root, then run it with wp eval-file. It sorts the registered tags and prints the file and line where each callback is defined, which tells you at a glance which plugin, theme or core file owns it. We ran it on PHP 8.5 against a small test script and linted it on 18 November 2026.
<?php
/**
* List every registered shortcode and the file that defines its callback.
* Run with: wp eval-file list-shortcodes.php
*/
global $shortcode_tags;
$tags = $shortcode_tags;
ksort( $tags );
foreach ( $tags as $tag => $callback ) {
try {
$ref = new ReflectionFunction( Closure::fromCallable( $callback ) );
$file = str_replace( ABSPATH, '', (string) $ref->getFileName() );
printf( "%-30s %s:%d\n", $tag, $file, $ref->getStartLine() );
} catch ( Throwable $e ) {
printf( "%-30s (callback not resolvable)\n", $tag );
}
}wp eval-file list-shortcodes.phpTypical output looks like contact-form-7 wp-content/plugins/contact-form-7/includes/contact-form-functions.php:229, one line per tag. A “callback not resolvable” line means the plugin registered a function that does not exist, which is itself worth reporting to its developer.
Keep two limits in mind. The list only shows shortcodes registered during that request, so a plugin that registers tags only on certain pages or only in the admin may be missing from it. And WP-CLI loads WordPress without a front-end page, so an inactive plugin’s shortcodes will never show; activate it on a staging copy first. If you do not have a staging site, setting up WordPress on localhost takes a few minutes and is the safest place for this kind of digging.
No WP-CLI? Install a lightweight “shortcode list” plugin from the directory on a staging site, or paste the loop above into a temporary admin-only snippet. Remove it when you are done; there is no reason to leave a debugging tool on a live site.
How do I use a plugin shortcode in the block editor?
The block editor still runs shortcodes. You have three options, and they all end in the same do_shortcode() call on the front end:
- The Shortcode block. Type
/shortcode, pick the block, and paste the tag. This is the cleanest option because the block keeps the tag on its own, away from paragraph formatting. Core has shipped this block since WordPress 5.0. - A Paragraph block. Pasting a shortcode into normal text also works, because WordPress filters the whole post content. It is fine for inline output, but block-level output (a form, a table) can end up wrapped in paragraph tags.
- A plugin’s own block. Many plugins now offer a block that does the same job with a visual preview, for example Contact Form 7’s form selector block and WooCommerce’s product blocks. When a block exists, it is usually the better choice.
Shortcodes also work in widget areas. WordPress 7.1.4 runs do_shortcode() on the classic Text widget and on block widgets through the widget_text_content and widget_block_content filters. In block themes, the Site Editor templates are processed too: the function that renders a block template calls do_shortcode() on the whole template, so a Shortcode block in a header or footer template part works on the front end even though the editor shows the raw tag.
The one spot that still catches people is a classic theme that loads block-based template parts. A long-running core ticket, #56780, reports that Shortcode blocks inside those parts are not expanded; it was still open in the Future Release milestone at its last public update in January 2025.
Are shortcodes still worth using now that WordPress has blocks?
Yes, for the right job. Blocks are the default way to build content in WordPress today, and when a plugin offers both, we pick the block. Shortcodes still earn their place in a few situations, and this table sums up how we decide.
Question | Shortcode | Block |
|---|---|---|
Preview in the editor | Shows the raw tag | Shows a live or close preview |
Works in the classic editor and old posts | Yes | No |
Works in widgets, template parts and page builders | Almost everywhere text is filtered | Only where blocks are rendered |
Easy to paste into many pages at once | Yes, it is plain text | Use a pattern or synced pattern |
What happens if the plugin is removed | The raw tag shows as text | The block shows an error or nothing |
Settings | Typed as attributes, easy to mistype | Chosen in the sidebar with validation |
A practical rule from our own site builds: use the block for anything a non-technical editor will touch, and keep shortcodes for places blocks cannot reach, such as a page builder module, a custom field that a theme passes through do_shortcode(), or hundreds of legacy posts you have no reason to rebuild.
WooCommerce shows the shift clearly. Its documentation says that stores set up after version 8.3 (November 2023) get the Cart and Checkout blocks by default, while older stores often still run the [woocommerce_cart] and [woocommerce_checkout] shortcodes. Both are supported, and the cart and checkout guide explains how to switch between them.
How do I find where a shortcode is used across my posts?
Before you deactivate a plugin, find every post that uses its shortcodes, or those tags will show up as plain text. WP-CLI can search post content directly (checked on 18 November 2026):
wp post list --post_type=any --post_status=publish --s='contact-form-7' --fields=ID,post_type,post_titleThe --s argument uses the normal WordPress search, which looks in titles, excerpts and content, so check each result. Searches of the database itself are more thorough and also catch drafts and revisions:
wp db query "SELECT ID, post_type, post_status, post_title FROM $(wp db prefix)posts WHERE post_content LIKE '%[contact-form-7%' AND post_type NOT IN ('revision')"The wp db prefix call fills in your real table prefix, so the query works on sites that do not use wp_. Developers can do the same check from PHP with has_shortcode( $post->post_content, 'contact-form-7' ), which is what many plugins use to load their CSS and JavaScript only on pages that need them.
Shortcodes can also hide outside post content: in widgets (stored in options), in theme settings, in custom fields and inside page builder data. If a removed plugin still leaves tags behind after you have cleaned the posts, search those places next. Our guide to the tables in a default WordPress install shows where each kind of data lives.
What happens to shortcodes when I deactivate a plugin?
The tags stay in your content, but nothing is registered to handle them, so do_shortcode() leaves them alone and visitors see the raw text, brackets and all. Nothing is lost: reactivate the plugin and the output comes back. That is very different from a block, where a removed plugin usually leaves an error message in the editor.
You have three ways to deal with leftovers:
- Replace them. Swap the old tag for a block or for the new plugin’s shortcode. For many posts, use
wp search-replaceon a staging copy first, with--dry-runto see the count. - Hide them. Register an empty shortcode with the same name in a small must-use plugin, so the tag renders nothing until you have time to clean up. This is a stopgap, not a fix.
- Strip them from excerpts and feeds. WordPress already does this for automatic excerpts:
wp_trim_excerpt()runsstrip_shortcodes(), which removes registered shortcodes. Unregistered leftovers are not stripped, which is why they can appear in excerpts too.
If you are checking whether a plugin is active before showing something, our explainer on how is_plugin_active() works covers why that check alone does not prove the plugin’s code, and its shortcodes, are loaded yet.
How do plugin developers register a shortcode?
If you are writing your own plugin, the pattern is short. The callback receives the attributes, any enclosed content and the tag name, and it must return its output as a string. Here is a minimal, safe example we linted on PHP 8.5 on 18 November 2026:
<?php
/**
* Plugin Name: TWP Notice Shortcode
*/
add_action( 'init', function () {
add_shortcode( 'twp_notice', 'twp_notice_shortcode' );
} );
function twp_notice_shortcode( $atts, $content = null, $tag = '' ) {
$atts = shortcode_atts(
array(
'type' => 'info',
),
$atts,
$tag
);
$type = in_array( $atts['type'], array( 'info', 'warning' ), true ) ? $atts['type'] : 'info';
return sprintf(
'<div class="twp-notice twp-notice--%1$s">%2$s</div>',
esc_attr( $type ),
wp_kses_post( (string) $content )
);
}Usage: [twp_notice type="warning"]Back up before you update.[/twp_notice]. A few habits keep a shortcode out of trouble:
- Return, never echo. Echoed output prints before the post body instead of where the tag sits. If you call a function that echoes, wrap it in
ob_start()and returnob_get_clean(). - Prefix the tag. WordPress’s own documentation for
add_shortcode()warns that if two plugins register the same tag, the one loaded last wins. A prefix such astwp_avoids the clash. - Treat attributes as user input. Anyone who can write a post (contributors included) can type your shortcode with any attribute value. Validate against an allow list and escape everything you print.
- Pass the tag as the third argument of shortcode_atts(). It enables the
shortcode_atts_{$shortcode}filter so site owners can change your defaults without editing your code.
The official Shortcodes chapter of the Plugin Handbook and the reference pages for add_shortcode() and shortcode_atts() cover the rest.
Common mistakes people report
These problems come up again and again in support forums and issue trackers. We paraphrase each one and link the source. Checked on 18 November 2026.
- Shortcode output appears at the top of the post. In a WordPress.org support thread for a logo slider plugin, a user found the shortcode echoed its HTML, so it printed out of place; buffering the output and returning it fixed it, and the author shipped the same fix in a later release. (WordPress.org support, last updated April 2021)
- A pasted shortcode does nothing. A Participants Database user found a filter shortcode only worked when typed by hand. The plugin author explained that pasting can carry invisible characters, and the visual editor can turn straight quotes into curly ones, which breaks attribute parsing. (WordPress.org support, November 2019)
- Raw shortcodes appear after a plugin is removed. After uninstalling one plugin to switch to another, a site owner saw slider and signup shortcodes printed as plain text across the site, because nothing registered those tags any more. (WordPress.org Fixing WordPress forum, May 2017)
- Shortcode blocks in template parts stay unrendered. On classic themes that load block-based template parts, Shortcode blocks are not expanded; the core ticket remains open, and the workaround discussed there is to run
do_shortcode()on the template part output. (WordPress Trac #56780, last activity January 2025) - A payment method vanishes after a checkout change. WooCommerce notes that extensions which declare themselves incompatible with the Checkout block may not show as expected, and it offers a one-click switch back to the classic
[woocommerce_checkout]shortcode. (WooCommerce documentation)
Frequently asked questions
Do all WordPress plugins have shortcodes?
No. Only plugins that output something inside your content tend to have them. Many newer plugins offer blocks instead, and background plugins such as caching or security tools usually have none.
Where do I paste a plugin shortcode?
In the block editor, use the Shortcode block. You can also paste it into a Paragraph block, a Text or Custom HTML widget, or a block theme template part. Page builders usually have a dedicated shortcode module.
Can I use a shortcode in a PHP template file?
Yes, with echo do_shortcode( '[your_shortcode]' );. If you know the plugin’s own PHP function, calling it directly is faster, because it skips the regular expression parsing.
Why does my shortcode show as plain text?
Usually the plugin that registers it is inactive, the tag is misspelled, or the place you pasted it does not run shortcodes (some custom fields and titles do not). Run the WP-CLI list above to see whether the tag is registered at all.
Are shortcodes bad for site speed?
Not by themselves; parsing is quick. What matters is what the callback does, for example running a heavy database query or loading scripts on every page. Well-built plugins use has_shortcode() to load assets only where the tag is used. If you are worried about the total load of your plugins, see our look at whether 50 plugins is too many for a store.
Can a shortcode run inside another shortcode?
Only if the outer shortcode’s callback calls do_shortcode() on its enclosed content. WordPress does not nest them automatically, so check the plugin’s docs before stacking tags.
Plugins we build and run
We maintain these ourselves, which is why we can support them on your site.
- BuddyNextThe self-hosted community engine for WordPress
- BuddyXFree community theme, Pro when you outgrow it
- ReignPremium community theme. Add pieces, build anything
- JetonomyCommunity forum and Q&A for WordPress
- EventonomyEvents and RSVPs for WordPress communities
- LearnomyCourses and learning communities on WordPress
- ListoraDirectories and listings your members can browse
- SnipShareCode sharing built for developer communities
- WB Ad ManagerAd placements that turn traffic into revenue
- WP Career BoardA job board your community actually uses
- WP Sell ServicesSell services with offers, orders, and payouts
- MediaVersePhotos, video, and media albums for members
- WB GamificationPoints, badges, and rewards that keep members active
- Product RoadmapPublic roadmaps with voting your users trust
Related Posts

LiteSpeed Cache Vulnerability CVE-2026-93389: Check Your Version and What Was Exposed

Freemius SDK Stored XSS: How to Find Every Bundled Copy on a Client Site (Anything Under 2.13.5)
