How to display WordPress shortcodes as a text?

Last day working on documentation of the BWL Advanced FAQ Manager Plugin, and I need to display FAQ shortcodes as text inside the documentation. I pasted the shortcode inside the documentation page, and when it was displayed on the front end, the shortcode executed and displayed its contents. That causes a lot of issues. However, I found a small trick to display the shortcode as text. Just add another starting and ending bracket before and after the shortcode syntax. Here goes an example-

Original Shortcode:

[bwla_faq meta_key = ‘votes_count’ orderby = ‘meta_value_num’ order = ‘DESC’ /]

Text Version of Shortcode:

[[bwla_faq meta_key = ‘votes_count’ orderby = ‘meta_value_num’ order = ‘DESC’ /]]

Note: You need to add these reference codes only in the text editor of WordPress, not in the visual editor. Adding in a visual editor will consider it was alphabets and special characters.

That’s it. I hope that tips will help you to display shortcodes as text on your site. Happy coding!

Total 0 Votes

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Leave a Comment

Back To Top