Skip to Content

WordPress Feature: Shortcode

Let’s talk about what the WordPress shortcode is.  Here’s the definition from, “A shortcode is a WordPress-specific code that lets you do nifty things with very little effort. Shortcodes can embed files or create objects that would normally require lots of complicated, ugly code in just one line. Shortcode = shortcut.”

You can apply a shortcode using a Shortcode Block in the editor. You can paste your shortcode into the block. Here’s an example of this with the contributors shortcode:

Screenshot of the shortcode block, using contributors shortcode

Use the preview button to see what the shortcode looks like:

Example of the contributors list on a post or page

Another useful shortcode is the [clear] code. Sometimes when aligning several images and paragraphs, you made end up with images and paragraphs that don’t clear the last image. The post ends up looking like this:

Page with strange image and text alignment issues.

You can address this by putting in a shortcode block using clear in between the sets if images and text.

A shortcode block is inserted after the second paragraph with a [clear] shortcode.

The end result looks a lot better:

Images and text are better aligned on the post or page.

We have several shortcodes, like Slideshow and columns, and we will talk more about these in the next few posts related to shortcodes.