how to make $page['content'] stop replacing HTML In my page (basic page content type) I have the following code in the body field

&lt;h3 class="blue-txt"&gt;Heading&lt;/h3&gt;


In my custom themes page.tpl.php I have

&lt;?php print render($page['content']); ?&gt;


However the rendered content replaces the h3 with a p and stripes my class for some reason and I need it to render the code that I saved. 

&lt;p&gt;header&lt;/p&gt;


However, if I use the following then it will print correctly:

&lt;?php print field_get_items('node', $node, 'body')[0]['value']; ?&gt;


If I use that then when I navigate to any of the default pages, mainly the admin login I get an error as $node is not defined. I added a conditional to check that $node was defined to prevent the error. After that the error wasn't displayed but since $node was supposed to contain the content, no content is displayed.

What am I doing wrong here? I just need my page to print out the body without deciding it should edit my code for me and I don't understand why $page['content'] is butchering my code.
Try going to admin/config/content/formats/html where 'html' is your WYSIWYG profile and check your filter processing order.

Mine:

Insert view filter
Convert Media tags to markup
CKEditor Link Filter
Convert URLs into links
Correct faulty and chopped off HTML
Limit allowed HTML tags

If I put 'Limit allowed HTML tags' at the top I get similar issues to what you are describing.

EDIT: The order did not actually cause the issue for me. I had just forgotten to add &lt;h3&gt; to the allowed list.