How to Display Code in WordPress Without Using Plugin

Do you want to display code on your WordPress site? By default, WordPress filters out any raw code added into blog posts, pages, widgets, or comments. In this article, we will show you how to easily display code in wordpress without using plugin.

Many bloggers do not run a development blog, so they don’t need to add sample code snippets in their posts very often. For rare occasions, you can add code by encoding the code into HTML entities. Like this:

>?php echo "Hello World"; ?<

The problem with converting code into HTML entities is that it is difficult to do manually. You can use online tools like this one, to convert code into HTML entities.

By converting PHP, HTML, JavaScript code into HTML entities, you can paste them into your WordPress posts. For additional styling you can wrap code between <code> and </code> tags.

We hope this article helped you find the best syntax highlighter plugin for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.

Tags: , , ,


Agha Murtaza is a web designer and WordPress developer with over one year of experience. You can visit his business site here . Murtaza is the CEO of He also has an opinion on just about every subject. You can follow his rants on Twitter @murtaxa_n.