Support » Plugins » Where in the code does WordPress re-add paragraph tags to the content?

  • When you look at the html of your post or page (or what is stored in $wpdb->posts.post_content), you’ll notice that there are no <p>‘s but instead just double spaces. Somewhere between when WordPress reads the content from the database and when it displays it on the page, it recreates a <p> from double spaces.

    Why do I need to know? I whipped up a little hack/plugin that adds the TinyMCE editor onto the excerpt field to allow for formatting. All works fine, except for the functionality I described above. For example:

    What I put in:
    First line

    Second line

    Third line

    What gets displayed:
    First line Second line Third line

    Thanks! Any help would be appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • whooami

    (@whooami)

    Member

    whoami,

    That filter is run on both Content and Excerpt. I see no change when I disable the filter (/wp-includes/default-filters.php. I wish you were right though.

    Andrej

    Sorry to burst your bubble, but whooami is correct. wpautop is the only filter in the code that adds those P tags to the content. If disabling it did not work for you, then you did not actually disable it correctly or something.

    Are you using page caching, perhaps? WP-Super-Cache?

    Also, it doesn’t turn “double spaces” into a P. It turns double line breaks into paragraph markers.

    Otto42,

    Thanks for your response. I will look into disabling wpautop another way (other than commenting it out in /wp-includes/default-filters.php which I already tried). Any chance you can suggest a specific approach?

    I’m not using any server-side cache and cleared my browser cache, just to be sure.

    You know what I meant by double-spaces so I’m not sure why you feel the need to correct me.

    Andrej

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Where in the code does WordPress re-add paragraph tags to the content?’ is closed to new replies.