Do shortcodes hurt SEO in WordPress?
No. A shortcode is a placeholder that WordPress swaps for real HTML on the server while it builds the page, so search engines receive the finished content and never see the bracketed tag. What can hurt is a shortcode whose plugin has been removed, leaving raw [tags] in your text.
How a shortcode becomes HTML
When a post is displayed, its stored content passes through a series of filters. One of them finds registered shortcodes, such as [gallery ids="4,8,15"], calls the PHP function attached to each, and inserts whatever HTML that function returns. In core this runs after paragraphs are formed and before images in the content are given their loading and size attributes.
By the time the response leaves your server, the shortcode no longer exists in the page:
Stored: [hydrogen_seo_toc]
Sent: <nav class="..."><ol><li><a href="#grind-size">Grind size</a></li>...</ol></nav>
Googlebot fetches that HTML like any browser would. No JavaScript is required to see the result, which makes shortcode output more dependable for indexing than content a script injects after load. Text, headings, links and images produced by a shortcode are indexed and followed as part of the page.
The exception is a shortcode that only prints an empty container and a script, leaving the content to be fetched by JavaScript. That is a property of that particular plugin, not of shortcodes. Check by viewing the page source: if the words are there, they are server-rendered.
The real risk: orphaned shortcodes
WordPress only replaces shortcodes that are registered. Deactivate the plugin or switch away from the theme that registered one, and core leaves the tag as plain text:
Our opening hours are [business_hours location="north"] and you can book below.
[booking_form id="3"]
That is what visitors and Google now see. The content the shortcode produced is gone, the page may have become thin, and the literal tags can be indexed. Page builders that store whole layouts in shortcodes are the extreme case: remove the builder and every page becomes a wall of brackets.
Before removing a plugin or changing theme:
- Search your content for its shortcodes. In the Posts list, search for the opening bracket and name, such as
[booking_form. - Replace each with a block or with the plain content.
- Afterwards, search Google with
site:example.com "[booking_form"to catch any that were indexed.
If raw shortcodes are already live, the fix is the same: replace or remove them, and the pages are corrected on the next crawl.
Where shortcodes do not run
Shortcodes are processed in post content and in a few other places core chooses, such as text and block widgets. They are not processed everywhere:
- Automatic excerpts. When WordPress generates an excerpt from content, it strips shortcodes first, so their output is not part of the excerpt. Archive pages showing excerpts will not include a shortcode's content.
- Meta descriptions. An SEO plugin building a description from content usually strips them too. If your opening paragraph is produced by a shortcode, write the description by hand.
- Titles, custom fields and theme text, unless the theme deliberately processes them.
- Word counts in the editor, which count the tag, not its output.
That last point misleads content checks. A page whose stored content is one shortcode can look empty to a tool reading the editor, while the live page has 1,500 words. Judge by the rendered page; our free audit and the word counter both work from what a visitor would receive.
Performance and good practice
A shortcode costs whatever its function costs. A table of contents built from headings is trivial. A shortcode that queries hundreds of posts or calls a remote service on every view slows the server response for that page. Page caching hides this for most visitors, but if a page with a particular shortcode has a slow time to first byte, test it with the shortcode removed.
For new content, blocks are the better default. They show the result in the editor, they are easier to move and they do not leave a cryptic tag in the text. Shortcodes remain useful where a block cannot go, for instance inside a classic widget or a template field. Hydrogen SEO offers both for this reason: a Table of Contents block and the [hydrogen_seo_toc] shortcode, and an HTML sitemap block and [hydrogen_seo_html_sitemap], described in table of contents and HTML sitemap.
Whichever you use, confirm the output in the page source once. If you can find the words with a text search of the source, so can a crawler.
Common questions
Can Google read content generated by a shortcode?
Yes. The shortcode is replaced by HTML on the server, so the content is in the page Google downloads.
Why are shortcodes showing as text on my site?
The plugin or theme that registered them is inactive, or the tag is mistyped. WordPress leaves unregistered shortcodes untouched.
Do shortcodes slow down WordPress?
Only as much as the code behind each one. Most are negligible; ones that run heavy queries or remote requests can slow uncached pages.
Are blocks better than shortcodes for SEO?
The output is equally visible to search engines. Blocks are easier to edit and fail more gracefully, which makes mistakes less likely.