Wondering how to use shortcodes in your WordPress website? In this tutorial, you’ll learn:
- How to use shortcodes
- Why we use them
- Some shortcodes in Real Estate Manager
How to Use Shortcodes
A shortcode is a method for including special content in the contents area of WordPress Post or Page.
For example, the Real Estate Manager plugin gives users a shortcode to add a search property form to their site. Here’s what that shortcode looks like:
To use a shortcode, simply copy and paste it into the contents of a Post or Page. Make sure you paste it without wrapping it in code or pre tags.
If you installed the Real Estate Manager plugin, you would then see a Search Form displayed on the front end of the site.
Any plugins that use shortcodes will provide you with one or more shortcodes that you can copy and paste.
Why Are Shortcodes Used?
Think about this from the developer’s perspective:
Imagine you made a plugin that lets users create a search form. Now, you need a way for them to add it to their site. You could force them to publish a special “Search” page, but what if they want to display other text above/below the form? What if they want to call it something other than “Search”, or add that form to multiple pages?
The solution is to give users a shortcode to insert the search form. Shortcodes are extremely flexible and allow you to place content from a plugin, like a search from, anywhere on your site.
Examples of Shortcodes
To give you an idea of how incredible and useful shortcodes can be, here are a few more shortcode examples that are included in Real Estate Manager Plugin.
I hope you understand the importance of WP Shortcodes. Now instead of being worried about them, you can look for them in most of the plugins you install.