If you have a WordPress site, you’ve probably heard about shortcodes or even noticing more buttons in your post editor or theme and plugin documentation. Shortcodes are basically little snippets of text in brackets that tell WordPress to do certain things when that shortcode is present within a page or post.
One shortcode that most are familiar with is [gallery]. This shortcode is what WordPress inserts into a post when you use the Insert Gallery function to display a bunch of photos that you just uploaded into WordPress on a page or post.
A little Shortcode History
Introduced in WordPress 2.5 is the Shortcode API, a simple set of functions for creating macro codes for use in post content. It enables plugin and theme developers to create special kinds of content (e.g. forms, content generators) that users can attach to certain pages by adding the corresponding shortcode into the page text.
Another example of a shortcode is with the contact form plugin I use on this site, Ninja Forms. Once I set up my Project Inquiry form to my liking in the plugin’s control panel, I simply inserted the provided shortcode on my Project Inquiry page and wallah! The form displays just the way I set it up.
I know I am dating myself, but back in the day, this form would have required minimally HTML coding and a server side CGI script that had to be configured as well! That’s what blows me away! Now with just a couple brackets and characters, anyone can add formatting to their site that would have been otherwise unavailable to non-developer types.
Shortcodes are the Bomb!
So you can see how shortcodes can make your life easier and your site cooler looking, right? Now, increasingly theme developers are using the WordPress Shortcode API to offer shortcodes that make formatting their themes to your liking much easier.
Shortcode use and integration vary by theme, by developer and by plugin so when looking at new themes, look for the menu tab “Shortcodes” in the theme’s demo to see what shortcodes will be available for your use.
For example, Elegant Themes integrates shortcodes and has a shortcode plugin to help you do so. Elegant Themes offers an entire collection of formatting shortcodes that they integrate into their themes including:
Elegant Themes is just one example. Most theme and plugin developers are integrating shortcodes into their products. Check out some WordPress Premium themes that use shortcodes — you will be blown away too!
At your service,
P.S. Disclosure: Some of the links in this post are “affiliate links.” Read my full Affiliate Disclosure Statement here.