Published at

How to Find and Fix Broken Wordpress Shortcodes

Learn how I find and fix broken Shortcodes in Wordpress with Screaming Frog

Authors
  • avatar
    Name
    AJ Dichmann
    Twitter
  • VP of Digital Strategy at Globe Runner
Table of Contents

If you’re running a WordPress site, you’ve probably used shortcodes for snippets like [gallery] or [contact-form-7 id="123"] that help embed dynamic content. But when plugins get deactivated or themes change, these shortcodes can break, leaving messy code on your pages and broken functoinality.

The good news? You can use Screaming Frog SEO Spider to find and fix these broken shortcodes.

Why You Should Care About Broken Shortcodes

Broken shortcodes:

  • Make your site look unprofessional
  • Disrupt the user experience
  • Hurt your SEO if visible in the page source
  • Signal plugin issues or outdated content

Let’s walk through how to find them using Screaming Frog and plus some bonus tips on using regex to catch tricky ones.

Step-by-Step: Scan for Broken WordPress Shortcodes

1. Open Screaming Frog & Crawl Your Website

  • Launch Screaming Frog SEO Spider.
  • Type in your domain and hit Start to begin crawling your site.

2. Set Up Custom Searches

To catch broken shortcodes, you need to tell Screaming Frog what to look for.

Go to:
Configuration > Custom > Search`

There, you’ll add searches for shortcode patterns. These are typically surrounded by square brackets ([ and ]), like:

  • [gallery]
  • [contact-form-7 id="123"]

But you don’t want to see these rendered in your final site. So here’s how to search for them.

Option A: Basic Custom Search (No Regex)

Use a few simple strings like:

  • [gallery
  • [contact
  • [embed

You’ll catch specific shortcodes but you may miss broken or uncommon ones.

For full coverage, use regex (regular expressions) to match all shortcode patterns.

Example regex patterns:

PurposeRegex PatternExplanation
Any shortcode\[[^\]]+\]Matches anything in square brackets
Opening tag only\[[a-zA-Z0-9_-]+[^\]]*Catches broken or incomplete shortcodes
Orphan closing tag\[/[a-zA-Z0-9_-]+\]Finds unpaired closing shortcodes

In Screaming Frog’s Custom > Search tab, click Add, choose Regex, and paste in one of the patterns above.

After the Crawl: Where to Look

Once the crawl is finished:

  • Head to the Custom > Search tab
  • You’ll see all URLs where a shortcode (or regex match) was found

You can:

  • Click a result to preview the content in Screaming Frog
  • Export the list to CSV to fix in bulk

How to Fix Broken Shortcodes

Now that you’ve found them, here’s what to do:

  1. Check the plugin or theme responsible. Is it deactivated or deleted?
  2. Replace or remove the shortcode. You might want to replace it with an HTML embed, Gutenberg block, or plugin alternative.
  3. Test the page. Make sure the fix is clean and renders well on both desktop and mobile.

Bonus Tips

  • Exclude working shortcodes with content-specific logic in regex (if you’re advanced).
  • Schedule regular crawls to catch future issues before users do.
  • Pair with a content audit—you may find other issues like “Lorem Ipsum” text or outdated calls to action.

Broken shortcodes are easy to miss—but they leave an ugly mark on your website. Screaming Frog gives you the power to find and fix them in bulk, and with a little regex magic, you can get even more precise.

Whether you’re managing a blog, a business site, or an eCommerce store, this quick checkup could save you from SEO penalties and lost credibility.

Want help running a full audit or automating this process monthly? Reach out we’d love to help with cleaning up your Wordpress site!

Sharing is caring!