Support » Fixing WordPress » How to remove unwanted BR and P tags?

  • Mal


    It is very annoying that WordPress adds P and BR tags even if I don’t place new lines or enters in some places!

     <img src="work.jpeg" alt="">

    The code above can NEVER be added because WordPress puts some <br> tags everywhere. Any ideas on how to fix that?

    Same with this:


    Why does it put unwanted P tag inside? It is certainly WordPress bug and it creates code that is against W3C specification because of this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • In formatting.php Change the line

    function wpautop($pee, $br = 1)
    function wpautop($pee, $br = 0)

    For Removing p tags,check the below link,

    Hope this helps.

    Tom Cornar
    [sig moderated as per the Forum Rules]



    Forum Moderator

    No! Never, ever, edit WordPress core scripts. And do not encourage others to do so. Editing core scripts can bring down your entire site and/or open security holes for hackers to use.

    I’m tired of those chunky text bits with spaces and invisible
    Tried with the white-space property, didn’t work!
    How do I get rid of them since, some commenters refuse to leave the enter-key alone.


    I want this 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to remove unwanted BR and P tags?’ is closed to new replies.