First introduced in WordPress 2.5, shortcodes are small codes which could be embedded in posts or pages to execute different tasks.
For example [ gallery ] is a shortcode to insert a gallery into a WordPress post. Shortcodes could be enhanced with additional attributes like [ gallery id=”333″ ] which will show the gallery with id 333 in the post. WordPress themes sometimes comes with their own customized shortcodes.
WordPress default shortcodes include:
- [ audio ]
- [ video ]
- [ gallery ]
- [ embed ]
- [ caption ]
- [ playlist ]
Note: If you are copying a shortcode from above, delete the spaces between brackets.
To insert shortcode in post, create a new post and simply paste the shortcode with required parameters.