What is a shortcode and how to use them

You are here:
Estimated reading time: 1 min

If you have started learning about WordPress you will soon start hearing about shortcodes. You will be wondering what they are and how to use them.

A shortcode is a small piece of code that you put in your post/page or widgets that will display a specific feature for example a form you’ve created with Contact Form 7.
Underneath that code can be a simple or a complex function, depending on the final result of the shortcode.

Here is an example of a shortcode for a ConvertKit form. I got the shortcode code from my ConvertKit account panel.

How a shortcode is setup using a block

The result is an embedded form to join a newsletter but it could have easily been a calendar or a social media widget.

This shortcode displays a ConvertKit form

A few key points on Shortcodes

  • They come enclosed in brackets [my_shortcode]
  • They make your life easier
  • They add cool things to your posts/pages
  • A shortcode performs a specific function / adds a feature to your site
  • Samples of shortcodes: galleries, calendars, forms, social media
Keep in mind that shortcodes usually depend on the theme or plugin they came with, so if you change themes or disable the plugin, the shortcode will no longer work.

Thank you for reading.

Was this article helpful?
Dislike 0
Views: 7