How to Create your Own Shortcodes on WordPress to Replicate Content

Easy Shortcode Creator by WpPug

How to Create your Own Shortcodes on WordPress to Replicate Content

Last week we released our first plugin called “Easy Shortcode Creator by WpPug“, and it came about because of a need we had when developing our WordPress themes directory, and we did not find a ready solution: how to replicate some content on several pages without need to edit code?  Previously we had to edit the theme code by hand, use includes in php or replicate the content on many pages (and have a lot of work to edit all of them later). Now everything is resolved using our new plugin!

 

Easy Shortcode Creator: Overview

Easy Shortcode Creator by WpPug” allows you to easily replicate redudant information/data on different pages by defining them as shortcodes. You can use any type of content, like Text, HTML or Javascript. We are using it on our website, in the example below (products listed in our WordPress themes directory).

How to Create your own ShortCodes WordPress: Easy Shortcode Creator by WpPug

We had the need to repeat the above box on several different pages, with instructions for installing the WordPress themes. But adding one by one on each page will require a lot of work in the future, if we want to edit or remove it. This task was made much easier after the creation of the plugin, which left our editing page like this:

 

How to Create your own ShortCodes WordPress: Easy Shortcode Creator by WpPug

With a small shortcode created by our plugin, I can repeat the same content on many different pages, and remove it or change it in seconds. We can now easily replicate redudant information/data on different pages by defining them as shortcodes. The plugin allow to use any type of content, like Text, Images, HTML or Javascript. Which also makes it possible to use it to include adsense banners, facebook pixels, analytics codes, among others, on any page of my site.

You can download the plugin on the official WordPress repository, through this link: https://wordpress.org/plugins/easy-shortcode-creator-by-wppug/

 

How the Plugin Works

– It creates a new Custom Post Type, where you can create content as if it were a normal post.
– When you add a new post, it will generate a custom shortcode for this new created post.
– When you  paste the shortcode on another page, the created content will be displayed.
– When this post is edited, content will be automatically updated on all pages with the shortcode.
– You can create as many shortcodes as you want.

 

Installation Instructions

  1. Upload easy-shortcode-creator-by-wppug folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Click on the Easy Shortcode Creator link from the main menu
  4. Click on “Create new Shortcode”, create your first replicable content and publish.
  5. Copy the generated shortcode and paste it into another page or post to display the content.

 

Conclusion

This is a very simple but very powerful plugin, allowing many ways to use it. It is the first plugin developed by us from WpPug, and we are designing for many new plugins. If you have critiques or suggestions for new plugins, features or themes, please leave a comment below. Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *