Are Shortcodes Still Useful in Modern WordPress Themes?

Using Shortcodes in Modern WordPress Themes: Are They Still Relevant in the Block Era?
With the introduction of Gutenberg and full-site editing, WordPress has seen a shift in how content is created and managed. Gone are the days when everything was done through the Classic Editor—now users enjoy a more visual, block-based experience. However, one question often arises: Are shortcodes still relevant in today’s WordPress themes?
What Are Shortcodes?
Shortcodes are small snippets wrapped in square brackets, like [example_shortcode]
, that allow users to insert dynamic content into posts, pages, or widgets. They’ve long been a staple of WordPress functionality, especially before Gutenberg, offering a simple way to add galleries, forms, videos, or even custom code without touching PHP.
Gutenberg Blocks vs. Shortcodes
Gutenberg blocks aim to make website creation more visual and intuitive. Instead of memorizing shortcode syntax, users can drag and drop predefined blocks (like buttons, columns, or embeds) into their pages.
Still, shortcodes haven’t vanished—they’re just less visible.
In fact, many Gutenberg blocks still use shortcodes under the hood. For example:
- Fluent Forms and Contact Form 7 let you insert forms using shortcodes.
- WooCommerce provides shortcodes for products, carts, and account pages.
- Many gallery, slider, and membership plugins rely heavily on shortcodes for embedding advanced features.
Why Shortcodes Still Matter
- Plugin Compatibility
Most WordPress plugins still output shortcodes for easy embedding. It ensures backward compatibility and makes integration with classic themes or custom layouts seamless. - Global Use
Shortcodes work across widgets, post content, sidebars, page builders, and yes—even inside Gutenberg blocks via the Shortcode Block. - Custom Development
Developers continue to use shortcodes for adding reusable dynamic functionality. For example, you might use[latest_articles]
to show recent blog posts in multiple places, without duplicating code. - Portability
Shortcodes are portable across themes. Unlike some block layouts that might not carry over when switching themes, shortcodes continue to function as long as the plugin is active.
How to Use Shortcodes in Gutenberg
Using shortcodes in modern block themes is simple:
- Add a Shortcode Block from the block inserter.
- Paste in your shortcode (e.g.,
[contact-form-7 id="123" title="Contact"]
). - Publish or preview the page.
You can also embed them inside Paragraph, Column, or Group blocks if needed.
Best Practices
- Don’t over-rely on shortcodes for layouts. Use them for dynamic content, not for design-heavy components.
- Document your shortcodes if you’re a theme or plugin developer. Provide users with descriptions and usage examples.
- Fallbacks matter—if a plugin is deactivated, the shortcode will show as plain text. Use conditional logic where possible.
Conclusion
Despite the rise of blocks and visual editing, shortcodes remain a vital part of the WordPress ecosystem. They provide a flexible, backward-compatible way to include dynamic content—especially for developers and advanced users. While Gutenberg is the future, shortcodes aren’t going anywhere just yet.
Join me on X: @wpscriptly
*These scripts and plugins are provided as is with no guarantees or warranties. If you need assistance or run into issues, feel free to reach out via the contact page.
Comments: