If you write blog posts about technical topics, then adding code snippets to your posts can be useful. To do this, you must open the page/post where you want to display the code snippet and click the add block ‘+’ button.
Once you do that, just insert the Code block from the block menu and then add your custom code into the block itself.
Finally, click the ‘Publish’ or ‘Update’ button at the top to store your changes.
The code snippet will now be displayed on your WordPress site. For detailed instructions, see our tutorial on how to easily display code on your WordPress site.