Skip to content

How to Use the Shortcode Block in WordPress

WordPress shortcodes might feel like a relic from history, but many plugins still rely on shortcodes. Read on to learn how to use the shortcode block in the WordPress block editor.

What are WordPress shortcodes?

Shortcodes were built to take out the manual management of particular features on your website. For instance, if you wanted to display the most recent posts added to your website, it would be a lot of work to add, revise, and update your data regularly to ensure accuracy. That’s where shortcodes come in—they can do this for you.

Shortcodes are a small piece of code, indicated by [brackets], that can manage specific functions without your input. WordPress shortcodes can be used on pages, posts, and other content types.

In essence, shortcodes are a shortcut to displaying dynamic, changing content on your webpage. And as soon as you learn how to use a shortcode block, you’ll realize you’ve uncovered a shortcut to a shortcut!

How to Use the Shortcode Block

1. Find the shortcode for the plugin function

You will want to have the shortcode for the dynamic content on hand and ready to go. In this video, I crosscheck a Ninja Forms article to confirm that their shortcode is [ninja_forms id=1]. You will want to have the relevant information handy for your target content!

2. Search “Shortcode” when adding a new block to the editor

Surprise, surprise, there is a dedicated block for shortcodes! It can be found by manually searching “shortcode” when adding a new block.

3. Paste the shortcode into the box

All it takes is a quick Command / Ctrl + V (Paste, for the shortcut uninitiated) and voila. Be sure to copy and paste all elements of the shortcode, including the brackets (they’re essential). Save your draft and select preview to see if it is firing correctly.

Shortcode block in WordPress

Pro tip: You can paste the shortcode in a paragraph block, too.
If you prefer to insert your WordPress shortcode directly into a paragraph block, go for it! So long as you maintain all of the elements, your shortcode should still fire correctly, with or without the dedicated shortcode block.

The other pro tip: Making your own shortcodes is super easy. It can help you write faster and generally save you a ton of repetitive work. Learn how to make a WordPress shortcode

Yay! 🎉 You made it to the end of the article!
David Hayes
Share:

3 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Dimiter Kirov
December 20, 2020 12:25 am

Saved my life, David ! And not only today. Regards to Fred and You!

Dimiter Kirov
May 5, 2020 9:38 pm

Thanks David! Was aware of the shorcode block but didn’t know it would work in the paragraph block either.
Much appreciated!

Or start the conversation in our Facebook group for WordPress professionals. Find answers, share tips, and get help from other WordPress experts. Join now (it’s free)!