How to show XML in wordpress page

If we post the XML in a wordpress post, then it wont show properly. So we have to convert the <, > tags to HTML entities appropriately.  If its a small XML, then we can do it easily, but if its a big one, then its somewhat tedious.  I am using the below approach to handle this.

Access this online utility Free Formatter and convert the html tags with appropriate entities. Then add those snippet in the post surrounding with <pre><code> tags.

Please refer the below example,


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s