WordPress.org

Ready to get started?Download WordPress

Forums

How to remove unwanted BR and P tags? (4 posts)

  1. Looimaster
    Member
    Posted 1 year ago #

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

    <figure>
     <img src="work.jpeg" alt="">
     <figcaption>Caption</figcaption>
    </figure>

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

    Same with this:

    <blockquote>Quote</blockquote>

    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.

  2. TomCornar
    Member
    Posted 1 year ago #

    In formatting.php Change the line

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

    For Removing p tags,check the below link,

    http://urbangiraffe.com/plugins/disable-wpautop/.

    Hope this helps.

    Thanks
    Tom Cornar
    [sig moderated as per the Forum Rules]

  3. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    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.

  4. Caroline
    Member
    Posted 1 year ago #

    I'm tired of those chunky text bits with spaces and invisible
    's.
    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
    Dont
    Want
    This

    I want this :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.