Decorative Flower
Her Realm, Personal website and blog of Cole
Aug 17

How can I disable WP’s fucking autop filter?!

With one catch – only on certain pages. I’ve found two plugins that seem ideal but, WordPress it having none of it. I finally installed TinyMCE Advanced which shows, as suspected, WordPress is adding p tags in places they should not be. Actually, that would be /p tags. All I want to do is add some nice br tags but wordpress keeps switching them (or adding) damned /p tags without even adding the opening p tags.

I would gladly give up my first born to a person who has a plugin which actually disables autop. I honestly didn’t think I could be anymore frustrated than I have been this past day. Fuck you WordPress.

Edited to Add:

I can get my pages to validate if I manually add p tags to balance WP’s /p tags (even though that is not the tag I want there) or if I code a page in Textpad and copy it in as one long line. Unfortunately, after saving, WordPress splits my code so paragraphs and line breaks are on a new line so I have to copy it back into Textpad, change it to one continuous line and then add any changes because I cannot change it on the edit page without it fucking up.


12 comments on “How can I disable WP’s fucking autop filter?!”

  1. I know the feeling, when a plugin and wordpress doesn’t not want to work with each other. It happened with me a few days ago when I was switching layouts around.

  2. In this case, I really think it’s WordPress being hell bent on world domination. Ugh!

  3. try disabling the visual editor.. it should be in your settings somewhere.. or if not (as older versions of wp do not have that setting) there is a disable visual editor plugin (i use it) that will turn it off for you.

  4. Let me know if you find a solution! I too am sick of all of the paragraph tags being added without my consent or input! I’ve taken to adding values and such for the P tag in my CSS, so I at least have a little more control over how they ultimately affect my pages.

  5. Unfortunately, this doesn’t help. WP still inserts them, you just can’t see it. TinyMCE Advanced actually lets me see all the code it inserts but nothing successfully takes it out.

  6. My problem isn’t appearance but validation. I think most people would have given up long before. The plugin I linked to might work for others, though, I don’t know.

  7. Thanks for the link. And thanks for pointing out that my plug-in didn’t work out with your WordPress installation.

    I wrote you an e-mail, but I think I’ll comment in here so that others know of a possible solution. I’ll also update the code with a more helpful comment.

    I think that it may be an issue with how ‘the_content’ is called in the theme. I have tried several themes and the priority with which I’ve set up the filter, which is 9, has worked fine:
    add_filter('the_content', 'rm_wpautop', 9);

    However, you could try switching to the following line and see if that works for you.:
    add_filter('the_content', 'rm_wpautop');

  8. It’s interesting that the theme could have something to do with it. I’m going to go ahead and try it this way. We’ll see how it works!

  9. I hope it works for you, I have had so many problems with random plugins lately, I think some of them just don’t work with this version, sigh

  10. To remove wpautop use this in your theme’s functions.php file
    //disable auto p
    remove_filter (‘the_content’, ‘wpautop’);

    More information about this can be found in my blog post called, “Stop WordPress mangling your code” here:http://lynnepope.net/stop-wordpress-mangling-code

    Hope this helps.

  11. Thanks for the response. Unfortunately, that doesn’t make it easy to selectively remove it.

Skip to toolbar