WordPress turns HTML code to HTML entities

I’m 99% certain you’re editing in the Visual tab and need to be adding HTML in the Text tab. Change to the Text tab in the upper right and paste the HTML code in there.

If for some insane reason this is happening from the Text tab, disable all plugins and themes and make sure it’s not one of them causing it.

If it’s still happening, peace be with you, and add this to your functions:

function dawn_content_filter( $content ) {
    return html_entity_decode( $content );
}
add_filter( 'the_content', 'dawn_content_filter', 1 );

For the editor, you can use this function to convert the content that’s displayed in the editor. Keep in mind this will prevent you from being able to display code samples on your site because it will convert html entities into parseable html code. I’d still recommend checking for plugin/theme issues to make sure the issue doesn’t reside there.

function dawn_editor_filter( $content ) {
    return html_entity_decode( $content );
}
add_filter( 'the_editor_content', 'dawn_editor_filter', 1 );