WordPress is the most user-friendly content management system and gives an opportunity to create highly functional websites. You don’t need to be an expert in website building or hire a developer for creating a WordPress site. The best part is that you can reuse content blocks to save lot of time and create variations using shortcodes. In this article, we will all basic details about using shortcodes in WordPress and provide a list of top shortcode plugins for WordPress to add additional features in your site and make the website building easier.
What is a Shortcode?
Shortcodes are kind of shortcuts or add-ons which allows you to add more functionality and elements to your website. They have specific syntax and WordPress uses Shortcode API to convert the inserted shortcodes into relevant content on the published pages.
- WordPress offers some default shortcodes that you can use on any sites. In addition, your theme and plugin developer can make use of the shortcode API to offer additional functions.
- Through shortcodes you can easily add dynamic content such as embed videos, music, images and documents, add contact forms, carousels, image galleries and sliders to posts and pages.
- Essentially, shortcode gives you an opportunity to add custom code to your website to include additional features and content that would require extensive coding and programming work otherwise.
- You can reuse shortcodes to insert same element with different styles by adding additional parameters. Adding info message boxes are best example that you can insert a message with different colors for danger, info, warning and alert messages.
Be Away from Shortcode Themes
WordPress provides some built-in shortcodes to use and most commercial themes provide a multitude of shortcodes to choose from and utilize to customize the site. With that said, if you decide to change your theme, then you will definitely run into some issues, and you’ll lose the shortcodes used in the last theme. An obvious solution to this problem would be to use shortcode plugins. Shortcode plugins work a bit differently as they will let you add shortcodes that will remain with you even if you change your theme.
Note that most of the commercial themes that come with bundled page builder plugins offer hundreds of shortcodes. Simply be away from these themes as changing the theme will become an impossible task due to the spread of shortcodes all over your site.
Format and Types of Shortcodes
A shortcode is usually written with two square brackets, for e.g., [gallery] is the shortcode used to insert a gallery. You can add additional parameters to customize the appearance like below with image IDs and thumbnail size.
[gallery id="1,2,3" size="large"]
There are two types of shortcodes available in WordPress:
- Self-closing – these shortcodes do not need additional closing tags similar to single HTML tags. Above mentioned gallery shortcode is an example for this type.
- Separate opening and closing – many custom shortcodes are created with opening and closing tags. For example, [custom_shortcode]…..[/custom_shortcode].
Using Shortcodes in WordPress
If you are using the old classic editor, you can simply paste the shortcodes within square brackets as explained above. However, Gutenberg editor makes the task easier by offering “Shortcode” block.
You can insert/paste the complete shortcode inside the block which will be showing with appropriate markup on the published content.
Note that WordPress allows you to show the shortcodes as a plain text by using an escaping technique. For example, you can use the following syntax with starting and ending square brackets to write shortcodes as a text without converting using shortcode API.
However, this works only with default shortcodes and not with custom created shortcodes. Alternatively, you can use Code or Preformatted blocks for this purpose.
Shortcode Plugins for WordPress
Creating own shortcodes is not necessary when plenty of shortcode plugins available in WordPress. In this article, we will go over five of the best plugins specializing in shortcodes for WordPress. Most of these plugins are all free to use and will help you create great websites without having to code like a developer. In addition, we will also provide a list of default WordPress shortcodes that you can use without any additional plugin.
To kick our list off, we have the most popular Shortcodes Ultimate plugin developed by Vladimir Anokhin. The plugin has over 800,000+ installations to date, and provides over 50 different shortcodes, with a single click insertion whilst offering live preview options as well. Furthermore, the plugin has an extensive collection of visual and functional elements that you can utilize in the post editor, text widgets and in template files too. The plugin provides modern responsive designs and works with any WordPress theme, and the best part is it’s completely free. Shortcodes Ultimate also offers premium add-ons for creating additional skins, additional shortcodes and shortcode generator.
Here is a list of elements you can create with Shortcodes Ultimate plugin:
- Create a shortcode and add a name to it in the shortcode admin page.
- Next, insert the shortcode [sc name =”my_shortcode”] in your post or page.
- And that’s it, your shortcode is in the post or page that you wanted to customize.
Apart from being simple to use, this plugin also has multiple editors: code, visual, or text, and offers a simple one clicks solution in post editor to pick the shortcodes you want to insert. All in all, this is a great shortcode plugin option especially if you want to create custom shortcodes.
Meks Flexible Shortcodes is another great option to consider if you want to add some cool elements inside your website content. The Meks Flexible Shortcodes plugin, developed by Meks, provides a shortcodes generator user interface panel which can be used to quickly create and insert shortcodes. The plugin provides around 12 shortcodes such as Columns, Buttons, Icons, Social Icons, etc., that can be used to style and design your website as you see fit.
The Amr shortcode widget plugin is specifically focused on adding widgets or multiple widgets or a full widget area, i.e., sidebar using shortcodes. The plugin has over 80,000 active installations so far and is one of the best in its niche. The plugin works great for adding widgets to the sidebar by a basic drag and drop functionality, whilst also providing options to apply in the block editor. The plugin’s default action is that it will automatically find the settings for your theme’s sidebar and use the HTML of the sidebar to control the output of the widget. Overall, this is a great plugin for shortcode usage especially if you want to or are dealing with widgets.
The Woo Shortcodes Kit is the go-to plugin solution using shortcodes for eCommerce websites in particular. If you have an eCommerce website or are using WooCommerce as your ecommerce engine, then this plugin should be a no-brainer. The plugin has been translated into 3 different languages: English, Spanish, Portuguese/Brazilian, making it highly accessible. Furthermore, the plugin provides customization options for your WooCommerce store with over 60 different functions such as content restriction, advanced user data, security, messages according to number of orders, and shortcodes such as Access, my accounts page, Shop Page and Thank you page among others.
Default WordPress Shortcodes
Here is a list of default WordPress shortcodes that you can use any site:
As mentioned above, WordPress will convert inserted shortcodes into appropriate content and apply styles using the shortcode API.
Shortcodes Vs Block Plugins
The latest trend in WordPress is to get prebuilt patterns and blocks using one of the Gutenberg blocks plugins. The popular block plugins include Ultimate Gutenberg Blocks and Kadence Blocks. Whether you use blocks plugins or shortcodes plugins, you need the plugin to be active for the content to display properly on the published site. There are two major differences with blocks plugins:
- Deactivating shortcodes plugins will show the raw shortcodes on the site. While blocks plugin will not show any ugly shortcodes, the content will be distorted and unreadable. You can remove all unused shortcodes from frontend easily with another plugin and from the backend with SQL command. However, removing a block is not easy as removing a shortcode as there will be large number style elements applied to a block’s source code.
- With blocks plugin, you can visually customize the settings of elements inside the editor. For example, you can insert an info message and then add required color from the Gutenberg editor’s sidebar. This is not supported with shortcodes plugin and you need to paste all the content as a text inside a shortcode block. This may not visually appealing inside the editor as the styles will be applied only on the published content.
If you hate shortcodes, you can use blocks plugins as an alternative. However always be away from shortcode themes and heavy page builder plugins.
Shortcodes are an invaluable tool in WordPress that mustn’t be overlooked. The plugins listed in this article are the best of the best when it comes to implementing shortcodes, and each option fulfills a specific role from eCommerce specialization to widget integration. In our opinion, there isn’t a single option that is better than the others but if we had to choose one, it would have to be Shortcodes Ultimate. It is the most popular shortcodes plugin for a reason and offers everything you’ll need to start out, from a general perspective.