Home / Questions / Why does my WordPress post show raw HTML code instead of formatting?
Why does my WordPress post show raw HTML code instead of formatting?
Raw HTML shows as text when the editor treats the code as plain text. A Custom HTML block or the code editor view displays it correctly.
When you paste code into a paragraph, WordPress escapes the tags, so they show as text. The page then shows the tags, not the formatting.
Fix it
- Replace the paragraph with a Custom HTML block, and paste the code there.
- If you use the classic editor, switch to the Text tab before you paste.
- Check the code for a stray escape, such as
<, which shows the tag as text.
Keep code blocks for code that should show as text, and use a Custom HTML block for layout code.
Ready to act on this?
Get a written review of your site, or send us your question and we will reply within 24 hours.
Related services
Related questions
Not sure where your site stands?
Send us the details and we will reply within 24 hours with a clear next step.