Website

The Complete Guide to WordPress Shortcodes

Disclosure: Our content is reader-supported, which means we earn commissions from links on Crazy Egg. Commissions do not affect our editorial evaluations or opinions.

Disclosure: This content is reader-supported, which means if you click on some of our links that we may earn a commission.

When you hear the word “shortcodes,” you might not be sure what it means. Once you get through this guide, you’ll know exactly what a shortcode is and how to use it to create amazing WordPress content. Let’s dive in. 

Why WordPress Shortcodes Are So Important

WordPress shortcodes are important because they save you from two things: spending extra time creating elements for your website and learning to code. 

Shortcodes make it easy to add more involved functionalities to just about any part of your website, especially posts, widgets, and pages. Without shortcodes, you need to learn how to code a form or add Google maps into a post. You can either create your own shortcodes or download a shortcodes plugin to use them repeatedly. 

You can use shortcodes to add things to your website like:

  • A specific form
  • A call-to-action at the end of a post
  • An image gallery
  • A specific widget
  • Social sharing buttons

Below, we go through ways to improve your shortcode usage in both the short and long term. 

Quick Tips to Improve Your Site With WordPress Shortcodes Today

Use a WordPress Plugin

The easiest way to get started using shortcodes is to download the Shortcodes Ultimate plugin. Once you’ve activated the plugin, you’ll be able to access its extensive list of shortcodes which you can then customize and insert as a Gutenberg block. 

Shortcodes Ultimate, as you can probably guess by the name, enables you to use over 50 shortcodes to insert functions like:

  • Image carousel
  • Audio
  • Google map
  • Animation
  • Menu
  • Template
  • Divider
  • Pullquote
  • QR Code

Shortcodes Ultimate is one of the top shortcode plugins around, with more than 800,000 active installations and stellar five-star reviews. With Shortcodes Ultimate, you eliminate the need to learn how to code to create intricate functions that look professional to any visitor. 

Understand How A Shortcode Works

The term  itself is a combination of the words “shortcut” and “code.”

At its most basic, a shortcode is simply a piece of code within square brackets that you can copy and paste wherever you want a specific function to appear. 

WordPress introduced them back in 2008 for users to execute certain types of code within posts without having to actually code it themselves to create functions within their posts, pages, or widgets. 

While WordPress already comes with a few basic shortcodes built-in, you can download plugins that open your world to a wide array of different shortcodes which help you create feature-rich content. As mentioned previously, Shortcodes Ultimate is just one example of a shortcode plugin, and there are others you can try to see which one works best for you.  

Use the WPForms Plugin

Want to know an easy way to create user forms for your website using shortcodes? Download the WPForms plugin. The WordPress plugin is a personal favorite because of how easy it makes creating personalized forms for almost any need imaginable. 

The free WPForms gives you access to plenty of form features you can get by on if you only need the basics. However, if you want to take it a step further, the paid features get you access to more robust form creation tools for a broader range of needs.

Once you create your form with WPForms, you’ll be given a shortcode that you can insert just about anywhere. You’re likely inserting them in posts or pages. We get into how to do that through the WordPress Gutenberg editor next. 

Get Familiar With The Gutenberg Editor Shortcode Feature

Say you’ve downloaded the Shortcodes Ultimate plugin. What next? Well, the next best thing to do is to get familiar with how to work with shortcodes in your WordPress Gutenberg editor. 

Once you open a post or page you want to modify, inserting the shortcode of your choice can be as easy as clicking the plus icon, which should appear as you type in your editor. 

From there, you can click on the shortcodes icon to insert the shortcode feature into your editor. If you don’t see the shortcode icon right away, click on the Browse all button or search for “shortcode” in the search bar to find the shortcode block. 

Then you can click the brackets icon to access the complete list of shortcodes to find the one you need. There are a ton to choose from. We highly recommend you take the time to tinker with a few shortcodes to get a feel for what each of them can do. 

As you can see, the list of shortcodes is pretty extensive. If you need to embed a YouTube video, for example, you’d simply choose the YouTube shortcode. 

From there, you can customize a number of things about how you want your YouTube video to be displayed. 

Once you insert your desired URL, you can also choose the specific width and height of the video, whether you want the video to be responsive, and whether you want it to autoplay with sound. Once you hit the Insert Shortcode button, you’ll be good to go. You can see how your video will look to users by using the Preview button. 

Keep in mind that using a plugin like Shortcodes Ultimate can give you a bit more customization options for shortcode features you could include with your Gutenberg editor anyway. 

While you could simply embed your YouTube URL with a Gutenberg block and call it a day, doing so through a shortcode plugin like Shortcodes Ultimate makes it easier for you to customize features like width and length, whether you want autoplay to be on or off, and make your videos responsive. 

As Gutenberg evolves and creates new features, it’s continually adding more blocks that act like the shortcodes themselves. 

Get Familiar With WordPress Default Shortcodes

If you don’t want to add another plugin to your site, don’t worry. WordPress comes with its own set of default shortcodes. It’s a good idea to get familiar with each of them since they can be helpful if you only need to work with basic shortcodes. 

WordPress’s built-in shortcodes are:

  • : With the playlist shortcode, you’re able to display video or audio files.
  • : The video shortcode lets you embed video files.
  • : The audio shortcode allows you to insert straightforward audio files to your posts with play and pause buttons included.
  • : With the caption shortcode, you can add captions to things like images.
  • : The gallery shortcode lets you display a designated set of images within your site. 
  • : The embed shortcode lets you modify the attributes of your embeds. 

You can use the built-in shortcodes using the shortcode block in the editor and typing in your desired shortcode along with its specifications. 

Long-Term Strategies for WordPress Shortcodes

So far, we’ve revised a few short-term strategies you can use to get familiar with WordPress shortcodes. You can also use a few long-term strategies to make sure you get the most out of your shortcode usage. The following are a few worth trying out. 

Learn How To Create Your Own Shortcodes

If you want to create your own shortcodes, you can take one of two routes: learn to do it yourself by editing your WordPress theme files or downloading the Shortcoder plugin and taking the easy route.

Editing your WordPress theme files is something we only advise you do with the utmost caution. If you’re an amateur when it comes to editing or dealing with code, you’ll have a bad time if you make changes incorrectly and something on your site breaks. Though it’s worth pointing out that editing your theme files to create shortcodes is definitely doable if you have experience with PHP files. 

The choice is ultimately yours to make. We like to live easily, so we prefer to create our shortcodes using the Shortcoder plugin. 

Once you download and activate the plugin, it’s simply a matter of:

  • Naming your new shortcode with something you can easily identify
  • Pasting the HTML/JavaScript/CSS of the shortcode you want to create
  • Saving your new creation
  • Copying and pasting the shortcode Shortcoder provides you wherever you want.

Shortcoder is extremely easy to use, and we highly recommend it if you can’t find the shortcode you need. To start using Shortcoder with your website, download it free here. 

Keep Your Shortcode Plugins Updated

Though plugins make your life easier as you grow your WordPress site, they aren’t always guaranteed to stay updated by their creators. It’s good practice to check on your plugins now and then to make sure they’re updated to be compatible with the latest acceptable version of WordPress. 

If your plugin happens not to be updated over a long time, you can always try uploading another one, as there are a few to choose from. Keep in mind this might mean you’ll have to revise every post, page, or widget you’ve used a shortcode in. 

The more popular plugins almost always get regular updates. So while this can be a minor issue, it’s still a possibility. 

Mind Your Shortcode Usage

As you use shortcodes, keep in mind the more you use shortcodes throughout your posts and pages, the more you’ll have to manually keep track of and edit if you ever decide to delete your shortcode plugin.

The same can be true if you’re using a website theme that comes with proprietary shortcodes. The day you decide to switch themes, you’ll have to go back and edit all of your dead shortcodes. 

Our advice is that while shortcodes are an excellent and ultra-useful feature, use them sparingly. If there’s a shortcode you seem to use over and over again, it might be worth the time and investment to reach out to a developer so they can permanently build that feature into your site. Or potentially look for a plugin or theme that has the functionality built into it.

This way, you have the peace of mind of knowing that if you were to delete or change your shortcode plugin, you’d still have that recurring feature active throughout your site. 

As with keeping your shortcode plugins updated, this is more or less a minor concern. But it’s one worth keeping in mind as you modify and make changes to your WordPress site. Keeping a spreadsheet of what posts and pages have what shortcodes can be a good way to stay a step ahead if you think you will make changes in the future. 

This becomes more important the more content you publish as your site grows. Chances are, you’ll have to go back at some point to make changes. 

Next Steps

If you’ve made it this far down, we’ve talked your ear off on all things shortcodes. You know how to use them, the best plugins to add to your site for an awesome list of ready-to-use shortcodes you can customize, and you can create your own shortcodes if you want to. 

Around here, we like to keep learning, especially when it comes to all things WordPress. If you’re looking for an up-to-date WordPress review, we wrote one you can read here. If you’re wondering about the best WordPress plugins for your website, our list of the top 30 WordPress plugins will lead you in the right direction.

Hey, even the best of us run into errors we don’t quite know how to fix. That’s why we wrote The Beginner’s Guide To Identifying and Fixing WordPress Errors.

Before you go, if you’re wondering what your users actually do once they land on your site, we’ve gone out of our way to create a list of the 10 best heatmap plugins for WordPress you might want to bookmark for later reference.  


Make your website better. Instantly.

Over 300,000 websites use Crazy Egg to improve what's working, fix what isn't and test new ideas.

Free 30-day Trial