Skip to content

Create shortcode in WordPress

Shortcodes are one of the best things about WordPress. It makes it extremely easy to use.

A shortcode is a WordPress-specific code that lets you do nifty things with very little effort. Shortcodes can embed files or create objects that would normally require lots of complicated, ugly code in just one line. Shortcode = shortcut.

Let us create a simple form just to show you how easy it is.

  1. Open your functions.php
  2. Copy and paste the following code into your functions file.
  3. Place the shortcode on any WordPress page.
  4. You can also call a Shortcode with PHP.
    1.   do_shortcode(‘[showform]’);
function create_form(){
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname"><br>
Message: <textarea name="message"> Enter text here...</textarea>
add_shortcode('showform', 'create_form');


The Next Gen of Managed WordPress Service You deserve more than just a Hosting company! Hosting, Maintenance, Secure, Content updates and Cloud Backups

We are more than just a Hosting company!

AdminWP Host, Maintain (Site-care), Secure and Backup WordPress websites.