What WordPress Shortcodes Actually Are
WordPress shortcodes are bracketed macros like [gallery] or [contact-form-7 id="123"] that WordPress parses server-side and replaces with rendered HTML. They are defined by plugins and themes using the add_shortcode() function.
Because shortcodes are processed on the server, they never reach the client browser as shortcodes — the browser only sees the final rendered HTML. This is important: it means any transformation you do in a browser tool operates on the source text, not the rendered output.
What This Tool Actually Does — Honestly
This tool provides seven real transformations on WordPress content containing shortcodes. Each mode does exactly what its name says:
| Mode | What Happens | Reversible? |
|---|---|---|
| 🔍 Analyze | Lists every shortcode, its attributes, and flags malformed syntax | N/A (no change) |
| 🛡️ Escape | Wraps shortcodes in double brackets [[gallery]] so they display as literal text instead of rendering | ✅ Via Unescape |
| 🔓 Unescape | Reverses Escape — [[gallery]] becomes [gallery] and renders again | ✅ Via Escape |
| 📦 Base64 Attributes | Encodes attribute values that contain brackets or special chars as Base64 | ⚠️ Requires handler support |
| 🗑️ Strip | Removes all shortcode tags from content | ❌ Destructive |
| 📋 Comment | Wraps shortcodes in <!-- --> HTML comments | ✅ Remove comments |
| 🧹 Cleanup | Fixes malformed shortcode syntax (missing closing brackets, stray quotes) | ⚠️ Partially reversible |
What This Tool Cannot Do
- It cannot "obfuscate" shortcode logic. Shortcodes are parsed by WordPress's PHP engine. Browser transformations on source text cannot hide the logic from someone who has the source.
- It cannot change rendered output silently. If a shortcode renders something, it renders the same thing regardless of surrounding whitespace.
- It cannot hide which shortcode is being used from someone reading the source. Only Strip mode removes it, and that also removes the rendered output.
- It cannot protect API keys inside shortcodes. If a shortcode has
[api key="sk-123"], that key is visible in the source and in the database. It must be removed, not obfuscated.
Mode 1: Analyze — Detect Every Shortcode
Analyze mode scans the content and produces a report listing:
- Every shortcode name found (
gallery,contact-form-7, etc.) - Every shortcode's attributes and their values
- Whether the shortcode is self-closing (
[gallery]) or paired ([box]...[/box]) - Malformed shortcodes — like
[gallerywithout a closing bracket - Unknown shortcodes — those not in a known list (WordPress core + common plugins)
Analyze mode does not modify the content. It is a read-only inspection.
Mode 2: Escape — Display as Literal Text
WordPress has a built-in escape mechanism: double brackets. Writing [[gallery]] in content tells WordPress to display the literal text [gallery] without rendering it. This is useful when you want to show readers what a shortcode looks like in a tutorial or documentation.
This mode transforms every [shortcode] into [[shortcode]]. The rendered output now shows the literal shortcode text instead of executing it.
Mode 3: Unescape — Re-enable Rendering
The reverse of Escape. [[gallery]] becomes [gallery], which WordPress will now parse and render. Use this when you want to re-enable a previously escaped shortcode.
Mode 4: Base64 Attribute Values
Some shortcodes accept attribute values that contain brackets, quotes, or special characters which break the shortcode parser. For example, [embed code="if (a < b) { echo 'hi'; }"] may not parse correctly because of the angle brackets inside the attribute.
This mode Base64-encodes such attribute values, producing [embed code="aWYgKGEgPCBiKSB7IGVjaG8gJ2hpJzsgfQ=="]. WordPress parses the shortcode normally.
Mode 5: Strip — Remove Shortcodes
Removes every shortcode tag from the content, leaving only plain text and HTML. Paired shortcodes like [box]content[/box] become content (the tag is removed, the inner content is preserved).
Use this when you want to remove shortcode functionality without disabling the plugin. It is destructive — the rendered output of the shortcode is gone.
Mode 6: HTML Comment
Wraps each shortcode in an HTML comment: [gallery] becomes <!-- [gallery] -->. WordPress will not parse shortcodes inside comments, and the HTML renderer will not display comment content. This is similar to Strip mode but reversible — removing the comments restores the shortcodes.
Mode 7: Cleanup
Fixes malformed shortcode syntax:
- Missing closing brackets:
[gallery→[gallery] - Unbalanced paired shortcodes:
[box]text(missing[/box]) →[box]text[/box] - Stray quotes around attribute values:
[embed code='hi']→[embed code="hi"]
When to Use Each Mode
| Use Case | Recommended Mode |
|---|---|
| Learn what shortcodes are in a post | 🔍 Analyze |
| Show shortcode syntax in a tutorial | 🛡️ Escape |
| Re-enable an escaped shortcode | 🔓 Unescape |
| Fix a shortcode with problematic attribute values | 📦 Base64 Attributes |
| Remove all shortcode functionality | 🗑️ Strip |
| Temporarily disable shortcodes while keeping the source | 📋 Comment |
| Fix broken syntax from a bad copy-paste | 🧹 Cleanup |
WordPress Security Reality
When NOT to Use This Tool
- To hide secrets in shortcode attributes. Base64 is reversible and visible.
- To prevent shortcode theft. If someone can view your source, they see the shortcode names.
- To replace proper WordPress security. Use proper plugins for authentication, capabilities, and content protection.
- To bypass plugin functionality. If a plugin blocks certain content, transforming it in this tool does not bypass the block server-side.
Frequently Asked Questions
What is a WordPress shortcode?
[gallery] that WordPress parses server-side and replaces with rendered HTML. Shortcodes are defined by plugins and themes using add_shortcode().Can this tool actually obfuscate shortcodes?
What does Escape mode do?
[[gallery]]). WordPress interprets this as "display the literal text [gallery] without rendering". This is a standard WordPress feature.Is Base64 encoding reversible?
Does Strip mode remove the shortcode's rendered output?
Can I use this on HTML files?
Does it work with Gutenberg blocks?
What about shortcodes in posts already published?
Is my content uploaded to your server?
Can I analyze a large number of posts at once?
wp post list combined with a custom script, or a plugin like "Shortcodes in Use".What counts as "unknown" in Analyze mode?
Does Cleanup mode risk breaking valid content?
Is Escape mode reversible?
[[gallery]] back to [gallery]. The transformation is byte-identical in both directions.