Support » Fixing WordPress » p tags in my content – invalidating mark-up

  • I have the visual editor disabled. Why is WP wrapping my content in p tags. There is one closing </p> tag after an image that I inserted. I do NOT want WordPress touching ANYTHING that I write in the editor.

    If it’s something I’m doing wrong, and someone knows for sure, please tell me. This is making me mad.

Viewing 8 replies - 1 through 8 (of 8 total)
  • I found a workable solution from about three years ago in the support forums. Anyway, I had to comment this line out in wp-includes/default-filters.php:

    //add_filter( 'the_content', 'wpautop' );

    I thought WP had grown to be a little more sophisticated than spitting out closing tags where they do not belong and invalidating code mark-up with silliness like this.

    Yea, I said it!

    Were you using the default Twentyten/Twentyeleven theme with no plugins activated? It could be an issue with a theme or a plugin that you have installed.

    Modifying core files isn’t recommended at all.

    Thanks for replying Jarret. I’m using the Graphene theme, but I use a child theme to do all my modifications. However, you’re right about that specific file though.

    I’m going to look at it in more detail tonight. If I have to, I will install fresh on my WAMP server with no plugins.

    WordPress seems to do this though even with the visual editor disabled. Am I the only one having the problem? I will definately check more thoroughly though and get back if I find it’s a theme or plug-in issue.

    I always use the html Editor, and it works with all the themes I use. So, it cannot be a typical WordPress problem.

    It’s not a problem, it’s by design. If you don’t like it, disable the feature.

    See (the section on disabling the filter).

    It does what you’ve done, but without having to modify core files.

    Thanks everyone. I will make that change and fix the core file I modified. Much appreciated.

    You are welcome!

    Crossing my fingers that WordPress development gives users an option to disable automatic <p> tags without having to be a .php developer or add some crazy plugin.

    I too do not want WP touching ANYTHING that I write in the HTML editor.

    In my case I’m using a custom theme with additional .js here and there. The addition of an automatic <p> tag is causing my markup to be invalid.


Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘p tags in my content – invalidating mark-up’ is closed to new replies.