Introduction
While the WordPress Block Editor has made building pages easier than ever, there’s still a powerful tool many people overlook: shortcodes. Think of them as a shortcut—a simple piece of text in square brackets that acts as a command, adding a special feature to your page or post without you having to write any complex code.
Understanding a few key shortcodes can save you time and give you more control over your website’s functionality. This post will walk you through the most popular shortcodes, from the ones built into WordPress to the powerful ones that come with the plugins you already use.
Section 1: The Basics – Core WordPress Shortcodes
WordPress includes a handful of shortcodes right out of the box that are incredibly useful, especially for managing media.
: This is the most common built-in shortcode. It allows you to quickly create a photo gallery from the images in your media library. You can add attributes likeid="1,2,3"to choose specific images orcolumns="3"to control the layout.: This shortcode lets you wrap a caption around any content, such as an image or a video. While the block editor handles this well, knowing this shortcode can be useful for older posts or for adding custom captions to specific elements.
Section 2: The Real Power – Shortcodes from Plugins
The true magic of shortcodes comes from the plugins you install. Many essential plugins provide shortcodes that let you embed their features anywhere on your site.
- Contact Forms: Every business website needs a contact form. Plugins like Contact Form 7 or WPForms give you a simple shortcode (e.g.,
[contact-form-7 id="123"]) that you can paste into any page to instantly display a fully functional form. This makes it easy to add a “Contact Us” form or a lead generation form to multiple pages on your site. - E-commerce (WooCommerce): If you run an online store, WooCommerce shortcodes are indispensable. You can use them to display your products on a non-shop page, show a product category, or even embed the shopping cart itself. For example,
[products]displays a list of your products, while[woocommerce_cart]shows the shopping cart. - Page Builders: Even popular page builders like Elementor or WPBakery use shortcodes behind the scenes. They allow for the complex layouts and widgets you create to be easily rendered on your page.
Section 3: How to Find and Use Shortcodes
Using shortcodes is a simple, three-step process:
- Find the shortcode: Most plugins provide a simple button in the classic editor or a specific block in the new Block Editor to insert their shortcodes. Alternatively, you can always find a list of a plugin’s shortcodes in its official documentation.
- Add the Shortcode Block: In the WordPress Block Editor, click the plus sign to add a new block, then search for and select the “Shortcode” block.
- Paste and Publish: Paste the shortcode you copied (e.g.,
[contact-form-7 id="123"]) into the block. When you publish the page, WordPress will automatically replace the shortcode with the feature it represents.
Conclusion
Shortcodes are a classic WordPress feature that continues to be a powerful tool for adding professional functionality to your website without a single line of code. By understanding the basics and knowing where to look, you can unlock a new level of control over your site’s content.
Are there any other shortcodes or website features you’re struggling to implement on your business website? Let me know in the comments!