Disable WordPress from adding <p> tags

Wordpress modifies and cleans your entered HTML both in the editor and at output.

Use this plugin to get unmodified markup into your posts:

https://wordpress.org/extend/plugins/raw-html/


Use this:

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

in your functions.php

Here's the complete answer: http://codex.wordpress.org/Function_Reference/wpautop#Disabling_the_filter


Try this in your functions.php

<?php remove_filter ('the_content', 'wpautop'); ?>

You can minify your code. Wordpress won't destroy code if everything is on one line.

I do that when I want to put <style> or <script> tags inside certain posts.

Tags:

Wordpress