As a blogger there are often times when you want to embed a form, video, or some other bit of HTML. If you aren't familiar with HTML or you simply don't want your post getting cluttered with excessive code, there's a handy feature in WordPress called shortcodes.
Many developers take advantage of the shortcode API to create plugins that let you embed all types of content into your post without the hassle of HTML. A shortcode is a simple tag inside your post that will automatically be replaced with the appropriate HTML when the post is loaded. Shortcodes can look as simple as [contact_form]
or have options set inside of them like [product id="3"]
or even be wrapped around a piece of information like [video]http://www.youtube.com/watch?v=Im4TO03CuF8[/video]
.
There are a lot of benefits to using shortcode plugins. Here are just a few:
- Less messy HTML in your posts
- Easier to learn and mange than HTML
- Include dynamic content like weather, tweets, etc.
- No need to go back and update old posts when plugins get updated
There are all kinds of shortcode plugins that make creating a great site easier, so don't hesitate to give shortcodes a shot. Before using one for videos, I'd recommend trying oEmbed. Leave a comment with your favorite shortcode plugin and keep an eye out for a tutorial on creating your own shortcodes.