WordPress- do not execute shortcodes inside code tags

I just noticed when I was trying to print on the page how to execute a certain shortcode, that the shortcode is executed even within the < code > tags.

I am trying to get it to where I can display EVERYTHING inside the code tags and not have wordpress do anything to it, ie:

Read More
<code>[shortcode]</code>

Exactly as you see the above line here on stackoverflow, I want it to display on my wordpress blog, even if [shortcode] is a shortcode (do not execute shortcodes).

I tried using strip_shortcodes() http://codex.wordpress.org/Function_Reference/strip_shortcodes

However, this actually takes the entire text out of the content, not just prevents it from being executed.

Any idea how to do this?

Related posts

Leave a Reply

2 comments

  1. I just found the answer and I thought instead of deleting my question I would answer it myself. I have been working with WordPress for years and have never heard of this issue.

    To get wordpress to display shortcodes and not execute them, you must use double brackets, ie:

    [[shortcode]]
    

    WordPress will display it in single brackets, unexecuted.