WordPress.org

Ready to get started?Download WordPress

Forums

[closed] automatic p tag insertion (15 posts)

  1. andi_g
    Member
    Posted 1 year ago #

    PLEASE remove the automatic insertion of <p> </p> in html entry fields !!!

    I am sick of working half an hour just because wordpress inserts p tags in wrong and idiotic positions.

    And than tell the customer: you can insert your code here, but maybe wordpress inserts wrong p tags and the content is formated wrong, but you can not fix it.

    even easy contact forms sends the mail message with p tag at the beginning and the end -> whats up ?? an i then have to hack the code of the plugin just to remove them ... argg

    remove this shit!

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    What html entry fields exactly?

  3. andi_g
    Member
    Posted 1 year ago #

    every html entry field concerning the content of pages, articles and so on

    i just have inserted some code to a html page which starts with a div, but wordpress decided that it wants the article to be started with a p tag and inserts one before my div. although a p tag at this position makes absolutely no sense. now i have a gap at the top of the page ... and i cannot remove it ... that is ridiculous

  4. andi_g
    Member
    Posted 1 year ago #

    i just realized that this behavor has something to to with tinyMCE advanced ... anyway .. the automatic p tag insertion in wordpress is nerve-racking

  5. fonglh
    Member
    Posted 1 year ago #

    It's your site, so you have to disable it yourself. The codex already explains how to do it.

    http://codex.wordpress.org/Function_Reference/wpautop

  6. k_nitin_r
    Member
    Posted 1 year ago #

    There's a plugin to disable the automatic P-tag insertion too, but I usually find it included in the themes that require it. Perhaps using nltobr would be more to your liking?

  7. nireder497
    Member
    Posted 1 year ago #

    Yeah, I hate this too! >.<

    It screws up my formatting every time I switch from visual to HTML editor for example. Or when I'm using a page builder from a 3rd-party and I need to manually edit a few things it will auto insert the <p> tag messing up the look of my page/post!

  8. andi_g
    Member
    Posted 1 year ago #

    @k_nitin_r: Plugin to disable automatic p-tag insertion didn't work for me. Up to now i didn't find a solution for that.

    I REALLY don't understand why there is no option in the admin to switch on and off automatic p insertion. AND switch on an off showing p tags and br tags in the html mode of the editor - so that i know which code is really there.

    so many people have problems with this, why don't you adress this, developers ??

  9. esmi
    Forum Moderator
    Posted 1 year ago #

  10. andi_g
    Member
    Posted 1 year ago #

    ok this removes the p-insertion from content and excerpts, but, for example, if i use easy contact forms and write a test mail, the mail text is also wrapped in <p></p>. This has also something to do with automatik p insertion. How to remove that ?

    And: why do i have to make changes in php to set such a basic option ?

    an the other problem is not solved with that: i want to see p tags in html mode of the editor. i simply want to see the code as it is!

    you can do that by installing tinyMCE advanced, but with the show-p-tag option of tinyMCE advanced other strange p-insertion problems come in -> so tinymce advenced is not a good option.

  11. k_nitin_r
    Member
    Posted 1 year ago #

    I'm not too sure if the P tags being inserted are by WordPress for the contact forms... if it is, there's bound to be a filter like the_content and the_excerpt to take away the wpautop filter.

    The reason why we have wpautop is that HTML ignores line breaks so we'd either have to use BRs, which aren't all that nice from a styling perspective from web designers that like to play with CSS, or P tags.

    P tags are a trade-off and there are very few people who find them an annoyance.

    You could be right about having it as a setting - the setting can be added by a plugin.

  12. andi_g
    Member
    Posted 1 year ago #

    ok again ... automatic processing / formating of the html code is annoying for a lot of people. the html code should be accepted as the user wrote it !! what a paternalism to assume the user is not able to enter html as he/she want it to be.

    All the ways to stop automatic p insertion / br removement do not word. Disable-p-insertion plugin does not work. inserting remove_filter(..) in the funktions.php does not work. the only thing that really disables this is commenting out the content of the wpautop function itself. but thats not the job of the user !

    How can one be that ignorant ? Insert an Option which controls if the content is filtered !!!!! An set it (globally) off by default !!!!!

    Damned ...

  13. Joseph Dickson
    Member
    Posted 1 year ago #

    It's possible to disable the auto <br /> and <p> to specific templates.

    Simply duplicate any page template then add the following to the source.

    <?php
    		remove_filter( 'the_content', 'wpautop' );
    		remove_filter( 'the_excerpt', 'wpautop' );
    	 ?>

    This way non web designers can still have the benefits of the automatic tag insertion and web designers can select the template with the feature turned off.

  14. sover
    Member
    Posted 11 months ago #

    I think I am having this issue as well. Do you add this code to the theme, or where?
    After ruling out that this is a problem with the theme I am using, I ran the code through an html validator and got this:

    http://cld.wthms.co/8taL

    My footer has bumped all the way to the top of the site and is pushing the content to the left hand side. Is it possible for the <p> tags (highlighted in red) to be causing this?
    The site is http://www.circuitmedia.com. Any help would be appreciated.
    Thanks

  15. esmi
    Forum Moderator
    Posted 11 months ago #

    @sover: As per the Forum Welcome, please post your own topic. This topic is 9 months old. Added to which, this is not a support forum.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags