How to Add HTML in a WordPress Blog Post

Most WordPress users spend their blogging life in the Visual Editor, the WYSIWYMG editor. Yes, it is the What You See is What You MIGHT Get editor.

While WordPress does what it can to make the Visual Editor emulate what your content will look like once published within your WordPress Theme, it has limits.

One of the limits is that is appears hard to publish HTML in a blog post. It isn’t. You just need to switch to the HTML or Text Editor on the Post/Page Panel.

Before you can publish code on your WordPress blog, there are some things you must know.

  1. WordPress automatically fixes poorly formed code. If you mess up a link or HTML element, WordPress doesn’t recognize it as properly formed code so it will “fix” it for you by replacing < with &lt; or change other code to make it appear as text.
  2. WordPress automatically strips out unwanted or broken code. If you are on , you are not permitted to publish JavaScript, PHP, or other code within your blog posts or elsewhere. But you can publish HTML if you have written it properly in the HTML/Text Editor.
  3. The WordPress Visual Editor expects everything within it to be publishable text or a shortcode, code that displays video and other media or features.
  4. The WordPress HTML/Text Editor expects everything within it to be HTML or something WordPress can use to generate HTML.
  5. WordPress recently changed the name of the HTML editor to Text editor in This change may be in an upcoming release of WordPress.

There are 66 HTML codes permitted in WordPress posts, Pages, and widgets, codes you can use to make lists, links, blockquotes, images, headings, whatever content you wish to add to your site.

WordPress Page or Post Visual and HTML or Text Editor.

To write in HTML in a WordPress site:

  1. In the Post or Page panel, switch to the HTML/Text Editor.
  2. Move your cursor to the spot where you wish to add the HTML.
  3. Paste or type the HTML in. Triple check to make sure you have it written properly.
  4. Save the draft, publish, or switch back to the Visual Editor to continue.

Here are more articles and information you can use on learning how to blog in HTML or use HTML in WordPress.


25 thoughts on “How to Add HTML in a WordPress Blog Post

  1. Pingback: Changing Blog Appearance « Pixeled Paper Designs

  2. Pingback: Happy Holidays and Onward! « Lorelle on WordPress

  3. Pingback: Family History Blogging Resources and Tips | Learning from Lorelle

    • Depends upon where you are putting the HTML. HTML is HTML and never needs to be “in” something special such as brackets. If you are putting the HTML in a blog post, just type it in the TEXT/HTML Editor not the WYSIWYG Visual Editor. If you are adding it to a Text Widget, just paste or write it in. Information on where to put it is in the article, so please be more specific with where you wish to put the HTML so I may help you set it right. Thanks.

  4. I’ve been trying all day to post a code from Stylesaint but t just won’t let me, and I now understand it is because it’s a javascript code.
    This is really stupid because the whole point of making the stylebook at Stylesaint, is to publish it at my blog;(
    it works like a charm at Tumblr so I don’t get why they haven’t made it possible to do in WordPress.

    • Code such as JavaScript has the potential of doing more harm than good. is a shared publishing experience. That little innincent piece if code could unwittingly infect ir break thousands or more sites.

      If you wish to publish code freely, such as ads, you may pay for hosting and use the self-hosted version of WordPress.

      • Thanks for the reply:)
        It was only a lookbook with images I had made at another web site that I wanted to also share on my blog:)
        But I ended up sharing the link to it so it will have to do:)

  5. Hi Lorelle, kinda new to wordpress n I want to have a static page as home page and other pages to have a blog like look. How do i go about it pls.

  6. Pingback: Blog Exercises: Don’t Let Your Content Compete With Itself « Lorelle on WordPress

  7. Pingback: How To Write Custom Code In Your WordPress Posts - WPExplorer

  8. Pingback: WordPress Site Structure and Organization | Learning from Lorelle

  9. Pingback: Web Writing HTML Entities Cheat Sheet « Lorelle on WordPress

  10. Pingback: How to Use Google Forms to Grow Your Business | The Vicky Virtual Small Business Blog

  11. Pingback: Writers, here’s why you should learn Markdown –

  12. I’m trying very hard to get a post written in HTML up; it’s rather complex, having some styles set in the page and precise formatting, but it just vomits text back at me. I can open the code in chrome fine.

    • It has nothing to do with your web browser. If you are using WordPress, in a post or Page, switch to the HTML/Text editor and paste in the code.

      If you are doing this on, which it appears you are, they automatically screen out the crap code, affiliate stuff, javascript, and other stuff. This is done to protect the user and the other people on the server (and is a multiple site version of WordPress) from potential harmful code.

      If you have any experience with HTML, you should be able to figure this out. Just know that CSS styles will not work. CSS inline styles will work on

      Good luck with it.

      • I know it’s not a browser issue, just to verify that the code renders fine until its in WordPress.

        Styles are used pretty heavily here, so that’s probably part of the problem. Thanks.

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 )

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