Shortcodes vs Blocks vs Page-Builder Widgets in WordPress
WordPress shortcodes vs blocks vs page-builder widgets: how each works, when each makes sense, and how to move a site off old shortcodes without breakage.

On this page
- Shortcodes vs blocks vs widgets at a glance
- How shortcodes work
- How blocks work
- How page-builder widgets work
- WordPress shortcodes vs blocks: when to use which
- Performance: does one load faster?
- Cleaning up old shortcodes safely
- Converting classic content to blocks
- Custom shortcodes from your developer
- Common shortcodes you will meet, and their block equivalents
- What this means for agencies and editors
- A sensible default for business sites
- Quick check: how many shortcodes does your site rely on?
- When to get help
- FAQs
- Shortcodes are text tags replaced by output at render time, blocks are visual editor components, and page-builder widgets live inside a builder like Elementor.
- For new content, blocks are usually the best default; shortcodes still suit small dynamic snippets, and widgets make sense only on builder-built pages.
- Before removing a plugin, search the database for its shortcodes, because leftover tags show up as raw text on live pages.
In WordPress, shortcodes vs blocks comes down to this: a shortcode is a text tag in square brackets that a plugin replaces with output when the page loads, while a block is a visual component in the block editor that you can see and edit in place. Page-builder widgets, such as Elementor's, are similar to blocks but only work inside that builder. For most new content, blocks are the best default; shortcodes still have a place for small dynamic features, and widgets make sense when the page is already built with a page builder.
Below is how each works, when to use which, and how to tidy up a site full of old shortcodes. If you need help restructuring a site, it is part of my WordPress website development work.
Shortcodes vs blocks vs widgets at a glance
| Shortcodes | Blocks | Page-builder widgets | |
|---|---|---|---|
| What you see while editing | A text tag such as [contact-form id="3"] | A visual preview of the output | A visual preview inside the builder |
| Where it works | Almost anywhere text is rendered: posts, widgets, some theme areas | Block editor and block themes | Only on pages built with that builder |
| Settings | Typed as attributes in the tag | Sidebar panel with controls | Builder panel with controls |
| If the plugin is removed | Raw [tag] text shows on the page | Block shows an error or fallback in the editor | Content may disappear or break |
| Best for | Small dynamic snippets, legacy plugins | Most new content and layouts | Sites already committed to a builder |
How shortcodes work
A shortcode is registered by a plugin or theme in PHP. When WordPress renders the page, it finds tags like [gallery] or [product id="12"] and swaps them for the HTML the plugin returns. That makes shortcodes flexible: they work in the classic editor, the block editor's Shortcode block, text widgets and many page builders.
The downsides are real, though:
- Editors see a tag, not the result, so it is easy to break the attributes with a typo.
- Some themes registered lots of layout shortcodes (columns, buttons, tabs). If you change theme, those tags turn into raw text across the site.
- Nested shortcodes become hard to read and maintain.
How blocks work
Blocks are the building units of the block editor (Gutenberg). Each paragraph, image, button or contact form is a block with its own settings. Content is saved as HTML with small comments describing the block, so even if a block plugin is removed, much of the content often survives as plain HTML.
Blocks are what WordPress itself is built around now: block themes, patterns, synced patterns and full site editing all use them. Block themes and full site editing explains where that is heading, and custom Gutenberg blocks shows how agencies build their own for clients.
How page-builder widgets work
Elementor, Divi, Bricks and other builders have their own elements, often called widgets or modules. They are visual and powerful, but the layout is stored in the builder's own format. Deactivate the builder and those pages usually lose their design and sometimes their content. That lock-in is acceptable if you are happy to stay with the builder long term. Elementor vs Gutenberg compares the two approaches in more depth.
WordPress shortcodes vs blocks: when to use which
- Use blocks for normal content and new pages: text, images, buttons, columns, galleries, FAQs. Most good plugins now ship blocks as well as shortcodes.
- Use a shortcode for a small dynamic output where no block exists, for example a form from an older form plugin, a pricing table from a plugin, or a custom snippet a developer wrote for you. Place it in a Shortcode block.
- Use builder widgets only on pages already built with that builder, and avoid mixing builders across the same site.
- Avoid theme layout shortcodes for columns, buttons and boxes. Those belong in blocks or the builder, not in a theme you might replace.
Performance: does one load faster?
None is automatically fast or slow. Speed depends on how much CSS and JavaScript each plugin loads and whether it loads them on every page. Block-based pages often load less code than builder pages because they avoid the builder's framework, but a heavy block plugin can be just as slow. Shortcodes themselves add very little; the plugin behind them is what matters. If speed is a concern, why Elementor sites get slow covers the common causes, and WordPress speed optimisation is available if you want it handled.
Cleaning up old shortcodes safely
Older sites often carry shortcodes from themes and plugins that were removed years ago. They show up as raw text such as [one_half] or [button link="..."] on live pages. To clean them up:
- Take a full backup.
- Crawl the site or search the database (the post_content column of the posts table) for an opening square bracket followed by known tag names.
- List each shortcode, the plugin it came from and the pages that use it.
- Decide for each: keep the plugin, replace the shortcode with a block, or convert it to plain HTML.
- Convert a few pages by hand first to check the result, then use a careful search and replace for the simple cases.
- Check the pages on mobile and desktop afterwards.
A staging copy makes this much safer; see staging sites explained. If a plugin removal also caused conflicts, troubleshooting WordPress plugin conflicts helps narrow it down.
Converting classic content to blocks
Posts written in the classic editor appear as a single Classic block. The "Convert to blocks" option splits it into paragraphs, headings and images. It works well on simple content; check posts with tables, embedded forms or shortcodes afterwards. You do not have to convert everything at once: old posts can stay classic until you next edit them.
Custom shortcodes from your developer
A small custom shortcode is still a neat solution for things like showing the current year, a list of recent case studies or a phone number used in many places. Keep such code in a small site-specific plugin rather than the theme's functions file, so it survives a theme change. Plugin vs custom code in WordPress explains the trade-offs. For anything editors will use often, a custom block is usually friendlier.
Common shortcodes you will meet, and their block equivalents
| Shortcode type | Typical source | Block-based alternative |
|---|---|---|
| [contact-form-7 id="..."] and similar | Form plugins | The plugin's own form block, or a form plugin that ships blocks |
| [gallery ids="..."] | WordPress core (classic editor) | Gallery block |
| [products limit="4"] | WooCommerce | WooCommerce product collection blocks |
| [one_half], [button], [tabs] | Older multipurpose themes | Columns, Buttons and Details blocks, or patterns |
| [embed] or video shortcodes | Core and plugins | Embed and Video blocks |
Exact names vary by plugin and version, so check the plugin's documentation before you replace anything.
What this means for agencies and editors
If you hand sites to clients, the editing experience matters as much as the design. Clients rarely remember shortcode attributes, and a mistyped quote mark can break a whole section. Blocks with locked patterns let editors change text and images without touching layout. For builder sites, restricting which widgets editors can use has a similar effect. Either way, document the few shortcodes that remain so the next developer knows why they exist.
A sensible default for business sites
For most small and medium business sites, a lightweight block theme or a classic theme with the block editor, plus a few well-chosen plugins that provide blocks, gives editors a clear editing experience and avoids lock-in. If your site is already built with Elementor and works well, keep it, but avoid adding a second builder or theme shortcodes on top. How to edit your WordPress content yourself shows what day-to-day editing looks like with blocks.
Whatever you choose, document it: which editor the site uses, which shortcodes remain and why, and which plugins provide blocks. That short note saves time for whoever edits the site next.
Quick check: how many shortcodes does your site rely on?
- Search content: in Posts, All Posts, search for
[plus a shortcode name you know, such as[contact-form-7, to see how many posts use it. - Check for broken ones: open a few old posts. A raw shortcode like
[button]showing as text means the plugin that powered it is gone. - Try a block: edit one post, add a block for the same feature and compare how it looks and how easy it is to edit.
When to get help
Get help when old shortcodes show as raw text, when you're moving to blocks after a theme change, or when editors find shortcodes confusing. Hire a WordPress developer to replace shortcodes safely, or see Elementor development and WordPress website development. Get in touch with the shortcodes you use.
FAQs
What is the difference between WordPress shortcodes vs blocks?
A shortcode is a text tag that a plugin turns into output when the page loads. A block is a visual component you edit directly in the block editor. Blocks show you the result while editing; shortcodes do not.
Can I still use shortcodes in the block editor?
Yes. Add a Shortcode block and paste the tag. Many plugins also offer their own block, which is usually easier for editors.
Why do shortcodes show as text on my pages?
The plugin or theme that registered them has been deactivated or removed. Reinstall it, or replace the shortcode with a block or plain HTML.
Are blocks faster than Elementor widgets?
Often, because block pages avoid loading the builder's framework, but it depends on the plugins involved. Measure actual pages rather than assuming.
Should I convert all my old content to blocks?
Not all at once. Convert pages as you update them, and prioritise pages with broken theme shortcodes or layouts that editors struggle with.
Need help with your website?
I'm a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote, usually within 24 hours.


