• Is there a way to disable the automatic <p> and <br> in the HTML editor? It’s messing up my code that I type by placing lots of <p> and <br> wherever I have line breaks. I only want line breaks when using the rich text format.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter itissue

    (@itissue)

    Any sort of help will be much appreciated.

    I’m having the same problem. I’ve installed the exec-php plugin on my site, and I’m making a page called “Tag Cloud” and am using the php function <?php wp_tag_cloud('smallest=8&largest=22&number=50'); ?> to automatically display the tag cloud on the page. The default format is “flat,” which I believe means it will just put some white space between each tag to result in a paragraph-looking cloud of tags. However, the automatic br tags are placing br tags between each tag, resulting in a long, long list.

    I understand wordpress wasn’t originally designed to handle php inside a post or page, but I think this really just boils down to the automatic br tags.

    I don’t see any way to fix this problem except to disable the automatic p and br tags in the HTML editor, just as itissue has asked.

    Hello All,

    It seems that you guys are using MS Word to write a post and copied into the HTML Editor. I recommend to use either any except MS Word to write a post. Because due to MS Word your blog may add br and P tag automatically at start/end of the post.

    Thanks,

    Shane G.

    cyberanto

    (@cyberanto)

    I tried all tricks and there is no way that wordpress keeps the
    tabs in the programing code. Therefore I had to use something else. I tried tables!

    Using tables will make you use more programing, unless you use the TinyMCE Advanced plugin, which helps you use tables more easily.

    With tables, when I need a single line break, I switch to the next row of the table. If I need a double line break, I leave an empty row in the table (<tr><td></td></tr>) The result, it gives me something like this.

    Does anyone know whether this is fixed in 2.7? I don’t seem to be able to save any class to any <p> or

      tags in my post.

    <p class="some_class">blah</p>

    will turn into

    <p>blah</p>

    after clicking ‘Save’.

    After struggling with this frustrating problem, I solved it by using the text control plugin: https://www.ads-software.com/extend/plugins/text-control.

    Once installed and activated, go to Settings->Text Control Config.
    Under “Posts & Excerpts”, select “No Formatting” in the first drop down list.

    That should get rid of all the automatic break tags being inserted.

    there is another solution

    <?php remove_filter(‘some_function’, ‘wpautop’); ?>

    for example ( TheNewDominion ) – put this anywhere on your page

    <?php remove_filter(‘wp_tag_cloud’, ‘wpautop’); ?>

    Thanks for the suggestions. But what about the missing CSS classes? Text-control only removes the automatic break tags. Does it also keep the classes I added in the tag? Please advise.

    I would like to disable automatic tags like <p> for code like <!–plugin–> which some plugins are using.

    TinyMCE converts to <p><!–plugin–></p>

    This causes invalid code because the code of the plugin starts with <div>…

    Is there a remedy for this special case?

    Well, I could write <div><!–plugin–></div> but it would be more complicated…

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Disable automatic p and br tags in HTML editor’ is closed to new replies.