Stop wordpress from adding html tags but not remove my own tags?

I've been trying to make wordpress stop adding html tags to my content but leave my own html tags alone?

Tried remove_filter( 'the_content', 'wpautop' ); and installed PS Disable Auto Formatting but the problem is that it removes my own html tags aswell?

I've tried to get_the_content() and the_content() but the same problem occurs there...

The way I wan't this to work is to let me add html tags and leave these alone, not removing them. Like this:

<p>Some text here</p>
<p>some more text <span class="fat"> fat </span></p>

Solutions

The only way i've ever found (& maybe also the only one that actually works)

Install & activate the plugin TinyMCE Advanced

Go to the plugin's settings page & check the box against "Stop removing <p> & <br> tags"

Go to your post's edit screen, switch between visual & html editor as often as you like & see the difference

Try accessing the $ post object inside your loop, and echo'ing the content from that. Something like:

<?php echo $post->post_content ?>

Edit

If you need to parse shortcodes, use do_shortcode() :

<?php echo do_shortcode( $post->post_content ); ?>

Similar questions

Stop Wordpress removing <script> tags when switching from HTML to Visual (TinyMCE)
Ok, I've seen solutions which go halfway to sorting out this problem, but nothing definitive, and nothing that 100% solves my problem. Scenario: How do I stop this from happening? I've tried adding custom code to my functions.php trying to access the extended_valid_elements for TinyMCE, but nothing works. Please help!
How to stop Wordpress TinyMCE from stripping content of empty html tags e.g. <div class="any class"></div>
I'm displaying some content in two columns in a Wordpress post, so I've got two divs displaying half each: But of course I also need to clear this, which I usually do with this afterwards: but this keeps getting stripped out whenever I save the article or view the visual editor as well as any other empty html tags e.g. icons. Is there a better way ...
WordPress wp_editor removes html tags - how to stop it?
Why does wp_editor remove all my html tags? This is my code: How can I stop it from removing html tags? For instance I type in this: It removes it. But if I type in plain text without html tags, It saves it. Any ideas?
WooCommerce - stop automatically adding product attributes (tags) to li class on archive page
Our WooCommerce website is running slower than I'd like, and in the process of debugging I've stumbled upon a question... WooCommerce automatically adds product attributes as classes on the product <li> tag in the category archive pages - e.g. <li class="post-2000 product type-product status-publish has-post-thumbnail product_cat-categoryh...
How to to stop html editor from addig <p> tags to shortcodes, images, etc
I know this this is covered as individual topics but What I am looking for is a single function that stops <p> tags from being wrapped around via the Wordpress editor to shortcodes and images and also removes empty <p> tages, for example: I have been using a few different functions that take $content and strips out the <p> tags vi...
Stop TinyMCE from deleting empty HTML tags
I'm developing a Bootstrap theme for Wordpress and it's very difficult to implement since Bootstrap uses empty tags with data-attributes and classes but TinyMCE removes the empty tags when I save the page I'm editing. Here is my code: It is part of the Bootstrap Carousel. Now I'm trying to add this to my front page using the text editor. Whenever I...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy .