How to Show HTML Code in Blog Posts (Blogger and WordPress Tutorial)

You're working on some code and you want to share it on your blog! Problem is when you type it, it disappears! That's because the site is running the code rather than showing it.
Here’s a quick and easy way to display HTML code in Blogger, WordPress, or any other site.

the new <, &, and > symbols

Anything between and after < > will be treated as code. So you can’t use those convenient keys on your keyboard. You’ll need to use HTML entities such as:

&lt; for < (less than sign)
&gt; for > (greater than sign)

In this example I’ll be using the inline element: <b></b>.

It’ll look like this:

&lt;b&gt; I'm trapped! &lt;/b&gt;

Then turns into this:

<b> Get me out of this box! </b>


And that’s it! Using &lt; and &gt; makes it super easy to show code on your blog without it running. Perfect for tutorials, guides, or any post where you’re trying to showcase HTML code. It’s some pretty simple code for a handy feature.

Leave a Reply

Your email address will not be published. Required fields are marked *