Developer · Guide
How to Get Shortcode in WordPress (Step by Step)

Short answer
Open the plugin's menu and go to the list of items you created, such as forms, tables or feeds, where the shortcode usually appears in a Shortcode column or Embed button. If it is not there, check the plugin's documentation, list all registered shortcodes with a small snippet, or create your own with add_shortcode.
Key takeaways
- Most plugins show shortcodes on their list or edit screens, often with a copy button.
- Plugin pages on WordPress.org often list shortcodes and their attributes.
- The global shortcode_tags array holds every registered shortcode name.
- Use add_shortcode or a snippet plugin to create your own shortcode.
- Paste shortcodes into a Shortcode block or a builder's shortcode widget.
How do you get a shortcode in WordPress?
Most plugins show their shortcode on the screen where you create the item, such as a form, slider, table or feed, usually in a Shortcode column or an Embed button you can copy from.
If a plugin does not show one, check its documentation or readme, or look up every registered shortcode on the site with a short code snippet.
If you need a shortcode for your own content, you can create one with a snippet plugin or a few lines of PHP. This guide covers each case.
What is a shortcode, quickly?
A shortcode is a short tag in square brackets, such as [gallery], that WordPress replaces with dynamic content like a form or a gallery when the page loads.
Plugins register shortcodes so you can place their features anywhere that accepts text. Many also offer blocks, but the shortcode remains a handy fallback.
WordPress core includes a few shortcodes of its own, such as gallery, audio, video, caption and embed. Most of the shortcodes you meet on a site, though, come from plugins and themes.
Our explainer on what a shortcode is in WordPress covers how they work in more depth.
Step 1: How do you find a plugin's shortcode in the dashboard?
Open the plugin's own menu in the dashboard and go to the list of items you created, such as All Forms or All Tables, where the shortcode is usually shown next to each item.
Look for one of these:
- A Shortcode column in the list table.
- A copy icon or Embed button next to each item.
- A box at the top or side of the item's edit screen.
Copy the full shortcode, including the brackets and any ID. The ID tells the plugin which form, table or slider to show.
If the list has no Shortcode column, open the Screen Options tab at the top right of the screen. Some plugins hide columns there, and ticking the box makes the shortcode visible again.
On newer plugins, the shortcode may only appear after you click an Embed or Publish button. These buttons often offer a block first, with the shortcode listed as an alternative.
Where do popular plugins show their shortcodes?
Each plugin places its shortcode in a slightly different spot, but it is almost always on the list screen or the edit screen of the item you created.
| Plugin | Where to find the shortcode |
|---|---|
| Contact Form 7 | Contact > Contact Forms, in the Shortcode column |
| WPForms | WPForms > All Forms, in the Shortcode column |
| TablePress | TablePress > All Tables, shown for each table |
| Smash Balloon | The feed list for each feed type |
| WPCode | The snippet screen, when the insert method is Shortcode |
| Elementor Pro | Templates > Saved Templates, in the Shortcode column |
Menu names change between versions, so if you cannot find it, check the plugin's documentation. Contact Form 7's getting started guide shows exactly where its shortcode appears.
For WooCommerce, the store pages and product displays use their own set of shortcodes. Our guide to WooCommerce shortcodes lists the common ones.
Step 2: How do you check the plugin's documentation?
Open the plugin's page on WordPress.org and read the Description and FAQ tabs, or search the developer's documentation site for the word shortcode.
Many plugins list their shortcodes, along with the attributes they accept. Attributes let you change things such as the number of items or the layout.
The Contact Form 7 plugin page is a typical example. Its description and FAQ explain how forms are added to pages, and the developer site covers the shortcode in full.
For example, a shortcode might accept attributes like this:
[recent_products per_page="4" columns="4"]
Look for the Installation or Usage sections too. Developers often put shortcode instructions there.
Still stuck? Search the plugin's support forum for the word shortcode. Other users have often asked the same question, and the answer usually includes the exact tag.
As a last resort, ask the plugin developer directly. Paid plugins normally include support, and a shortcode question is quick for them to answer.
Step 3: How do you list every shortcode on your site?
Run a short PHP snippet that prints the keys of the global $shortcode_tags array, which holds every shortcode registered by WordPress core, your theme and your plugins.
Add this as a temporary admin-only snippet with a tool like WPCode, then remove it after use:
add_action( 'admin_notices', function () {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
global $shortcode_tags;
echo '<div class="notice notice-info"><p>' . esc_html( implode( ', ', array_keys( $shortcode_tags ) ) ) . '</p></div>';
} );
Reload any dashboard page and a notice lists the shortcode names. Delete or deactivate the snippet once you have the list.
This shows names only, not the attributes each one accepts. Use the name to search the plugin's documentation for details.
You will usually see some names you do not recognise. Themes and plugins often register helper shortcodes for internal use, so do not worry if the list is longer than expected.
Our guide on how to use WPCode explains adding and removing snippets safely.
How do you find shortcodes already used in your content?
Search your posts and pages for the shortcode name or an opening bracket using the dashboard search, a search-and-replace plugin in dry-run mode, or WP-CLI.
The dashboard search under Posts or Pages looks inside content. Type the shortcode name, such as contact-form-7, to see where it is used.
This is useful before removing a plugin. Any page still using its shortcode will show the raw tag once the plugin is gone.
With WP-CLI, the search argument for wp post list finds posts containing a term:
wp post list --post_type=any --s="contact-form-7" --fields=ID,post_title
Step 4: How do you create your own shortcode?
Register one with the add_shortcode function in a snippet plugin or a small custom plugin, giving it a name and a function that returns the content to display.
A simple example:
add_shortcode( 'year', function () {
return date( 'Y' );
} );
You can then type [year] anywhere that processes shortcodes, and it shows the current year.
The add_shortcode reference and the Shortcodes chapter of the Plugin Handbook explain attributes, enclosing shortcodes and best practices.
Our guide on how to write a shortcode in WordPress walks through more advanced examples.
Can you get a shortcode without writing PHP?
Yes. Snippet plugins such as WPCode let you set a snippet's insert method to Shortcode, which gives you a ready-made tag for any HTML, text or PHP you add.
Steps in WPCode:
- Go to Code Snippets > Add Snippet.
- Choose the code type, such as HTML.
- Paste your content.
- Set the insert method to Shortcode.
- Activate the snippet and copy the shortcode shown.
The WPCode first snippet guide shows these settings. If the result does not appear, see our guide on WPCode shortcodes not working.
Can you get a shortcode for a block or pattern?
Core WordPress does not give blocks or synced patterns a shortcode, but some plugins add one so you can display a pattern in widgets, page builders or theme templates.
In most cases you do not need one. You can insert a synced pattern directly in the block editor and edit it once to update it everywhere.
Synced patterns were called reusable blocks in older WordPress versions. You can manage them all from Appearance > Editor > Patterns on block themes, or from the patterns screen linked inside the editor.
If you work in a page builder, check whether it has a template shortcode. Elementor Pro, for example, shows a shortcode for each saved template.
How do you use the shortcode once you have it?
Paste it into a Shortcode block in the block editor, a shortcode widget in your page builder, or a text widget, then preview the page to check it works.
The Shortcode block is the cleanest option. Search for Shortcode in the block inserter, paste the tag and save.
In theme files, wrap it in do_shortcode so it runs:
echo do_shortcode( '[contact-form-7 id="123"]' );
If you need to edit a shortcode inside Elementor, our guide on editing shortcodes in Elementor covers the widget settings.
What if the shortcode shows as plain text?
Plain text means the shortcode is not being processed, usually because the plugin is inactive, the tag is misspelled, or it was pasted into a block or field that does not run shortcodes.
Check that the plugin is active, compare the tag letter by letter with the plugin's version, and move it into a Shortcode block.
Our full guide on WordPress shortcodes not working covers caching, curly quotes and theme issues.
Frequently asked questions
Where do I find the shortcode for a contact form?
Open the form plugin's list of forms. Contact Form 7 and WPForms both show a Shortcode column next to each form with the form's ID included. Copy the whole tag, including the brackets, and paste it into a Shortcode block.
How can I see all shortcodes available on my WordPress site?
Add a temporary admin-only snippet that prints the names in the global shortcode_tags array as a dashboard notice. It lists every shortcode registered by core, your theme and your plugins. Remove the snippet once you have the list.
Do WordPress blocks have shortcodes?
No. Core blocks and synced patterns do not come with shortcodes. Insert them directly in the editor instead. Some plugins add shortcodes for patterns or templates, which can help if you need to display them inside widgets or page builders.
Can I create a shortcode without coding?
Yes. A snippet plugin such as WPCode can turn any HTML, text or PHP snippet into a shortcode. Set the snippet's insert method to Shortcode, activate it, and copy the tag WPCode shows on the snippet screen.
Why does my shortcode show as text on the page?
The plugin that provides it may be inactive, the tag may be misspelled, or it was placed somewhere that does not process shortcodes. Check the plugin, compare the tag carefully and move it into a Shortcode block.
Sources
- Shortcodes WordPress Plugin Handbook
- add_shortcode() WordPress Developer Resources
- Getting started with Contact Form 7 Contact Form 7
- How to Create Your First Snippet WPCode Docs
- Contact Form 7 WordPress.org Plugins
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


