What Are WordPress Shortcodes?

WordPress shortcodes are an ingenious way to add complex theme and plugin functionality to your website. You just put the shortcode snippet directly into your content and when your page is shown, WordPress swaps the shortcode snippet with the functionality defined within it.

[eeSFL allowupload="USER"]
  • The brackets define the shortcode section. Use double-brackets to show the actual shortcode text, which is how I can do that here. But why would you want to do that?
  • The “eeSFL” part fires a WordPress response that does the swapping. This is written in the plugin or theme.
  • The allowupload=”USER” part tells the theme or plugin to do or not do something. Here Simple File List is told to show the file upload form only to logged in users.

WordPress shortcodes can also contain content:

[pluginName do="this"]Hi! How are you?[/pluginName]

Sometimes themes and plugins will use this to show “this or that”. The enclosed content might be the default display, only replaced if a certain condition is met.

My Simple

Shortcode Block

Although you can can place a shortcode anywhere in your WordPress content, use the Shortcode Block if you can.

Don’t fear the shortcode.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.