WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a plug-in that embeds some javascript. I've tried using remove_filter() to stop wpautop in every way recommend and still can't get wordpress to stop wrapping my <script></script> tags with with <p> tags like this <p><script></script></p>

I tried adding the following to both the short code php and also in the functions.php

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt',     'wpautop' );
share|improve this question
Please provide the code that you have already tried. – Joseph Leedy Feb 16 '13 at 21:20
just modified the question with the code – John Carter Feb 16 '13 at 21:35

Here is one idea


function remove_stuff($content){
    return $content;
share|improve this answer
excellent idea, but it didn't have any impact. On further examination it appears WP is just adding a <p> tag before <script> and no closing </p>. At any rate, this code didn't stop it. The only way I've been able to totally prevent it is by tweaking wp itself and changing wpautop to just return without making changes – John Carter Feb 17 '13 at 0:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.