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.
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 < or change other code to make it appear as text.
The WordPress Visual Editor expects everything within it to be publishable text or a shortcode, code that displays video and other media or features.
The WordPress HTML/Text Editor expects everything within it to be HTML or something WordPress can use to generate HTML.
WordPress recently changed the name of the HTML editor to Text editor in WordPress.com. This change may be in an upcoming release of WordPress.