Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Troubleshooting

WPCode Shortcode Not Working: Causes and How to Fix It

WPCode Shortcode Not Working: Causes and How to Fix It

Short answer

A WPCode shortcode usually fails because the snippet is inactive, its insert method is not set to Shortcode, or the ID in the shortcode is wrong. It can also fail when pasted somewhere that does not process shortcodes, when conditional logic hides it, or when a PHP snippet outputs nothing.

Key takeaways

  • Only active snippets with the Shortcode insert method produce working shortcodes.
  • Snippet IDs change after imports, so copy the shortcode from the snippet screen.
  • Use a Shortcode block or builder widget, not a Code block or menu label.
  • Conditional logic and device rules can hide output while you test as an admin.
  • PHP snippets must echo output to show anything on the page.

Why is your WPCode shortcode not working?

A WPCode shortcode usually fails because the snippet is inactive, its insert method is not set to Shortcode, the ID in the shortcode is wrong, or the place you pasted it does not process shortcodes.

Other causes include conditional logic rules that hide the snippet, curly quotes in the shortcode, a PHP snippet that never outputs anything, and caching.

Most of these take seconds to check. Start at the top of this list and test after each change.

Is the snippet active?

Check first, because WPCode only runs active snippets, and an inactive snippet's shortcode simply outputs nothing on the page.

Go to Code Snippets in your dashboard and look at the toggle in the snippet's row. It should be switched on.

WPCode can also switch a snippet off for you. If a PHP snippet throws an error, WPCode may deactivate it to protect the site and show a notice. Fix the error, then activate it again.

If you are new to the plugin, our guide on how to use WPCode explains snippets, insert methods and the main screens.

Is the insert method set to Shortcode?

Open the snippet and look at the Insertion section, because a snippet set to Auto Insert runs in its chosen location and does not create a usable shortcode.

Change the insert method to Shortcode and update the snippet. WPCode then shows the shortcode to copy, which looks like this:

[wpcode id="123"]

The number is the snippet's ID. Copy it straight from the snippet screen rather than typing it by hand.

WPCode's guide to creating your first snippet shows where the insertion options sit in the editor.

Is the snippet ID correct?

Make sure the ID inside the shortcode matches the snippet you want, because IDs change when you import snippets to another site or recreate a deleted snippet.

This catches people after a migration. The page still contains the old shortcode, but on the new site that ID belongs to a different snippet or none at all.

Open Code Snippets, hover over or open the snippet, and compare its ID with the one in your page. Update the page if they differ.

Did you paste it where shortcodes run?

Paste the shortcode into a Shortcode block, a Paragraph block, or your page builder's shortcode widget, because places like code blocks, menus and some custom fields show it as plain text.

In the block editor, the Shortcode block is the safest choice. The Shortcode block documentation on WordPress.org explains how it works.

Common places where shortcodes do not run by default:

  • A Code or Preformatted block, which displays text exactly as typed.
  • Navigation menu labels and post titles.
  • Some custom field and theme option boxes.
  • Text inside HTML attributes, such as a link URL.

In page builders, use the dedicated shortcode element. Elementor has a Shortcode widget, and most other builders have an equivalent.

Our explainer on what a shortcode is in WordPress covers where WordPress processes them and why.

Are curly quotes breaking the shortcode?

They can be. If the shortcode was copied from a document, email or chat app, the straight quotes around the ID may have become curly quotes, and WordPress may not read the attribute correctly.

Look closely at the quote marks. They should be straight, like the ones in the example above.

The simplest fix is to delete the shortcode and type it again directly in the editor. Writing it without quotes, such as [wpcode id=123], also works for plain numbers.

Is conditional logic hiding the snippet?

Check the snippet's conditional logic, device type and schedule settings, because a rule that does not match the current visitor stops the shortcode from printing anything.

WPCode lets you limit snippets by page, user role, login status, device and more. A rule such as show only to logged-out users means you will see nothing while logged in as an admin.

Test this quickly:

  1. Open the snippet and turn off conditional logic for a moment.
  2. Set the device type to show on any device.
  3. Update the snippet and reload the page in a private window.

If the output appears, one of the rules was the cause. Add them back one at a time to find it.

Does your PHP snippet actually output anything?

A PHP snippet used as a shortcode must output something, such as echoing HTML, otherwise the shortcode runs correctly but shows nothing on the page.

A function that only defines another function, registers a hook, or returns a value inside a nested function will not display content where the shortcode sits.

Keep shortcode snippets simple. For example, this snippet prints a short line of text:

echo '<p>Free shipping on orders over $50.</p>';

The PHP manual entry for echo explains how it prints output, which is what makes text appear where the shortcode sits.

If you need full control, write a proper shortcode with add_shortcode instead. Our guide on how to write a shortcode in WordPress shows the pattern, and the add_shortcode reference on developer.wordpress.org lists its parameters.

Is the shortcode inside a theme template?

Shortcodes in theme files do not run on their own; you need to wrap them in do_shortcode, or the raw shortcode text appears on the page.

The pattern looks like this:

echo do_shortcode( '[wpcode id="123"]' );

Use this in a child theme rather than editing the parent theme directly. Theme updates replace parent theme files.

If do_shortcode itself seems broken, see our guide on do_shortcode not working for scope and timing issues.

Is caching showing an old version of the page?

Yes, sometimes. If you just fixed the snippet but the page looks unchanged, a page cache, host cache or CDN may still be serving the version without the output.

Purge your caching plugin and your CDN, then reload in a private window. Our guide on clearing cache in WordPress lists the steps for popular tools.

Caching also matters for dynamic output. A snippet that shows the current user's name or a random message will look the same for everyone if the page is cached. Exclude that page from caching, or load the dynamic part with JavaScript.

How do you debug a shortcode that still fails?

Turn on WordPress debugging, check the error log, and test the shortcode on a fresh draft page with a default theme so you can rule out builder and theme conflicts.

These checks narrow it down:

  • Raw text shows: the location does not process shortcodes, the snippet is not set to Shortcode, or the shortcode is misspelled.
  • Nothing shows: the snippet is inactive, a rule hides it, or the code outputs nothing.
  • Page breaks: the PHP has an error. Check the debug log.
SymptomMost likely causeFirst fix
Shortcode text visible on the pageNot processed in that locationUse a Shortcode block or widget
Empty space where output should beInactive snippet or conditional ruleActivate it and disable rules to test
Old output still showingCachePurge plugin, host and CDN caches
Critical error messagePHP error in the snippetRead the debug log and fix the code

The Debugging in WordPress documentation shows how to enable WP_DEBUG_LOG safely on a live site.

For shortcode problems that are not specific to WPCode, our broader guide on WordPress shortcodes not working covers plugin shortcodes, page builders and widget areas.

When should you contact WPCode support?

Contact support after you have confirmed the snippet is active, set to Shortcode, free of rules, and still fails on a clean test page, since that points to a plugin bug or conflict.

Include your WPCode version, WordPress version, the snippet type, the exact shortcode you used, and any errors from the log.

Free users can post in the plugin's WordPress.org support forum. Pro customers can use the support channel in their WPCode account.

While you wait, you can keep the page working by moving the code into an Auto Insert snippet that targets that page, or into a small custom plugin.

Frequently asked questions

Where do I find the WPCode shortcode for a snippet?

Open the snippet in Code Snippets, set the insert method to Shortcode and update it. WPCode then displays the shortcode with the snippet's ID next to the insertion options, ready to copy into a page, post or widget.

Why does my WPCode shortcode show as plain text?

The location you pasted it into does not process shortcodes, or the shortcode is misspelled. Move it into a Shortcode block or your page builder's shortcode widget, and check that the brackets, the name and the quotes are typed correctly.

Can I use WPCode shortcodes in Elementor?

Yes. Add Elementor's Shortcode widget to the section, paste the WPCode shortcode into it and update the page. Avoid pasting it into a Text Editor widget with code formatting, and clear any cache if the output does not appear right away.

Why did WPCode deactivate my snippet?

WPCode checks PHP snippets for errors and can switch off a snippet that causes a fatal error so the site stays online. Read the error notice, fix the code, test it on a staging site if possible, and then activate the snippet again.

Do WPCode shortcodes work with caching plugins?

They do, but cached pages show the same output to everyone. Static content is fine. If the snippet shows user-specific or changing content, exclude that page from caching or load that part with JavaScript so each visitor sees the right result.

Sources

  1. WPCode – Insert Headers and Footers + Custom Code Snippets WordPress.org Plugins
  2. How to Create Your First Snippet WPCode Docs
  3. Shortcode block WordPress.org Documentation
  4. add_shortcode() WordPress Developer Resources
  5. Debugging in WordPress WordPress Developer Resources

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.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.