WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Escaping shortcode (5 posts)

  1. splotch
    Member
    Posted 6 years ago #

    How do you escape shortcode in the post content? I've searched all over the site and can't seem to find it documented.

    I'm trying to document a plugin and I need to be able to show the shortcode in the post as it should be written, not have it replaced by my plugin.

    I know it's a simple solution, I just can't find what it is.

    Thanks for your help.

  2. splotch
    Member
    Posted 6 years ago #

    Apparently not too many people know how to escape shortcodes in a post. If anyone does know, please post it. I'm sure I'm not the only person looking for this.

  3. splotch
    Member
    Posted 6 years ago #

    I think I've finally dug up the solution. Instead of using the "[" and "]" characters, replace them with their respective html entity counterparts.

    [ => [
    ] => ]

    Hope that helps anyone else out there banging their head on the same problem.

  4. splotch
    Member
    Posted 6 years ago #

    Be careful switching between the Visual and HTML editors, as this will revert the [ to [ and cause your shortcode to be parsed.

  5. John Blackbourn
    Member
    Posted 5 years ago #

    Nice info Splotch! Thanks for sharing.

Topic Closed

This topic has been closed to new replies.

About this Topic