WordPress has a feature called shortcodes, which allow you to embed dynamically generated content, often from plugins, into your posts by wrapping the shortcode in square brackets [ and ]. For example, to embed a MailPress signup form, you go:

[[mailpress]]

This works great, unless you’re writing about WordPress plugins, and want to describe the shortcode rather than have it activate. In this case, you need to escape the shortcode by doubling the square brackets around it, like this:

[[[mailpress]]]

(If you’re really paying attention, you’ll realize that I had triple brackets around that last example while editing this article.)

Categories: Content

Graham

I'm the creator of BuildYourBlog.net.

3 Comments

Kopfweh Karsten · December 11, 2012 at 1:11 am

Yeah, I realized that when it gave me a syntax error in the very last line. Almost finished and then I still managed to f— it up. 🙁

Abel Braaksma · May 7, 2012 at 4:46 pm

This escaping mechanism doesn’t always work. I.e. with opening/closing and nested shortcodes you need a slightly different syntax. And when you only want to escape an opening shortcode, it can break your page if you just escape it by doubling it.

I tried to list some of the alternatives in this blogpost on escaping shortcodes.

    Hiinoush · September 22, 2014 at 4:22 pm

    First, my thanks to the aouthr of this column, as it cleared a lot of issues I didn’t know about. No matter how I have set the MailPress, the MP has been always sending emails over the limit allowed by the provider. Second, a little clarification that will save newbies, like me, a lot of time: The sample path MailPress gives you when you select “Submit batch with: Other:” is not a complete path, unless it starts with /usr/bin/php -f and ends with cron.php It was my case and it took me forever to figure out I had to insert it on the path manually. One more thing, I have to emphasize. You have to get email cron message with a simple “1”, anything else in the message is a sign of cron not set up properly. Jan Kasal recently posted..Petition The Malverne Board of Education

Leave a Reply

Avatar placeholder

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

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