What is Shortcoder?
A good example is with Adsense ad codes. You can create a “shortcode” for your Adsense code, give it a name like “adsensecode”, and then use it anywhere in your posts and pages by inserting the proper code.
How to Create and Use a Shortcode
Step 1: Install the plugin.
- In your WordPress admin area, go to PLUGINS > ADD NEW and search for “shortcoder”. Find the one by Aakash Chakravarthy (it should be the first one). Click INSTALL NOW, then on the next page, click ACTIVATE PLUGIN.
- You can also download it here. If you download it, install it by going to PLUGINS > ADD NEW. At the top click UPLOAD, find the file on your computer, upload it, and activate it.
Step 2: Create a shortcode.
- 2a- In your WordPress admin area, go to SETTINGS > SHORTCODER.
- 2b- Enter a name for your shortcode. This MUST BE in all-one-word form. You can’t use “this is my short code”… it should be “thisismyshortcode” or “this-is-my-short-code” or “this_is_my_short_code” or something like that. If you do it with spaces in the name, it won’t work.
- 2c- This part is just like writing a post. If you want to enter something like Adsense code, you have to click the TEXT tab… or you can do something fancy in the VISUAL side.
- 2d- Enter your code or design your pretty, pretty project.
- 2e- Save your code.
Step 3: Use the Shortcode.
- Find the spot in your post where you’d like to put the code and enter it (as shown in the picture). Remember, you have to put it in brackets, you have to start the code in the brackets with sc: and your code cannot contain any spaces.
Step 4: Marvel at your shortcoding brilliance.
- You can choose to PREVIEW CHANGES, or just save the post and view it to see your code. If it doesn’t look right to you, double check every step to make sure you’ve done everything right.
Still a little confused?
Our own Erica Mueller explains more.