Skip to main content

WordPress Tips & Tricks

WordPress Tips and Tricks

How Do I [insert the thing you are trying to do] in WordPress?

Here are some tips and tricks gathered in one spot

POT File Generation

  • POT files are translation source files for WordPress plugins
  • Pro will need a POT file for future use
  • Can we use a POT file as a way to test out different labels in the UI? Is that even worth doing?

Escaping Shortcodes in a WordPress Post

Summarized from this article

Double the Brackets

In the end, I found the solution in a ticket from 2007 in the Wordpress core issue tracker. It was something baked into Wordpress Core way back in version 2.5. And it’s very simple. Just double the brackets.

A shortcode with single brackets will be processed. By doubling the brackets, you’re escaping the square brackets.

So instead of typing:

[shortcode_here]

You’d type:

[[shortcode_here]]

With Opening and Closing Shortcodes

If you’re doing a line with opening and closing shortcodes, you’d only double-bracket the first and last instances, like this:

[[shortcode_here]TEXT HERE.[/shortcode_here]]

Like I said, it’s really simple. But probably because not many people need it very often, it’s not widely publicized. But if you’re one of those handful of people who do need it, hopefully this saves you some time and frustration.