using <> less than and greater than symbols in a wordpress post

When working on this post, <tags> dissapeared from the content when viewing the post, even when using <code> or <pre> tags.

I do not know how to escape these symbols without modifying the post content. I tried using <pre lang="c"> and <pre lang="php">, to no avail.

We can escape these symbols by writing &lt; instead of < and &gt; instead of >.

For example, to show

table <fail2ban> persist

we must write

<pre>
table &lt;fail2ban&gt; persist
</pre>

This also works with the <code> tag.

NOTE: It was not easy to write this post. I will not write a post about how I wrote this post.

Leave a Reply