How to Add a Shortcode in WordPress

0
73
How to Add a Shortcode in WordPress

Do you want to add a shortcode in WordPress? Shortcodes are generally known as small codes that enable you to perform various tasks with little effort. Due to their small nature, they help to make a site fast, SEO friendly, and well functioned which makes your site rank at the top in different search engines. 

WordPress developers can add a code easily inside a function and then register a function as a shortcode. In WordPress, the code runs automatically after it finds the shortcode. It allows you to replace the text with something else when the page is displayed. Many WordPress users even tell Shortcodes as shortcuts. 

Using shortcodes you can add widget or/and content from some other site or API. Many WordPress plugins also use shortcodes. You can create content with the plugin and use the shortcode to simply add the content wherever you want to display it.   

To add a shortcode is as easy as adding a post or pages to your website. Let’s get started to add a shortcode in your website.

Add a Shortcode in WordPress Classic Editor

Still, a few users prefer using WordPress Classic Editor. So if you are still using a WordPress Classic Editor we will go through the detailed steps to add a shortcodes in your website.  

You can add shortcodes in posts or pages after you are done writing the content. You can also edit the post or page that is available on your website.

Remember that you need to keep the shortcode anywhere inside the content editor where you want to display it. 

Add a Shortcode in WordPress.

If you haven’t published the article, then Publish it. If you have edited the existing article then click on the Update button after you are done adding the shortcode. 

View your article in order to see the shortcode running in action. 

Adding a Shortcode in Posts and Pages

First of all, you need to add New Post or Pages in your WordPress Website. For that click on Posts>>Add New. Remember that you can also edit the existing one. 

Click on the Add(+) button to insert your shortcode. 

Add Shortcode in WordPress.

Then Search for the Shortcode option. There you can see it then click on it. 

Add Shortcode in WordPress.

Simply paste the Shortcode then click on Publish or Update button as per your requirement. 

Add Shortcode in WordPress.

When you visit your website you will be able to see the changes. 

We hope it was easy for you to add shortcodes to your website. Additionally, go through our article “How to Add Tables in WordPress Posts and Pages?” if you want to add a visually appealing table to your WordPress posts or pages.

LEAVE A REPLY

Please enter your comment!
Please enter your name here