Those who want to create a code learning or technical WordPress websites will need to display code to the readers. It is easy to display raw code on WordPress blog post.
How to display raw code in WordPress blog posts or articles?
WordPress executes written content through multiple cleanup filters each time you save a post.
These filters assure that someone does not inject code via post editor to hack your website.
Below is an easy and proper way to easily display code on your WordPress blog. There are many ways but will only show two major methods of doing the job.
Method 1. Display Code Using WordPress Block Editor
This method is advised for newcomers and users who don’t need to display code very often. It’s the easiest way with adding a bunch of code to bloat the website.
Simply edit the blog post or page where you want to display the code. On the post edit screen, add a new code block to your post. That is just simple on how to display raw code on WordPress site.
Method 2. Display raw code on WordPress using Plugin
You only need to install and activate the SyntaxHighlighter Evolved plugin. Then you can get the block for that purpose. Follow the plugin settings and that is it. That’s how to display raw code on WordPress using a plugin.