• Resolved cellendhyll

    (@cellendhyll)


    Hello everyone,

    I know this question has been asked but I looked for answers for more than 2 hours and couldn’t find one.
    Wordpress is adding <p></p> tags to my code and it’s VERY irritating. I’d like to know how to disable this PLEAAAAASE. If you tell me to add some code in my function.php file, I’d like to know how to access it. I don’t have an “editor” tab in my “appearance” section.
    I have the version 4.6 of wordpress and my theme is Langwitch.

    Please help me :’-(

    Thank you all!

    • This topic was modified 8 years, 2 months ago by cellendhyll.
Viewing 2 replies - 1 through 2 (of 2 total)
  • If you are adding javascript or CSS to a post or page, you need to make sure there are no blank lines, or else WordPress will automatically add paragraph tags. If it’s adding paragraph tags to your HTML, then try enclosing your elements inside of a <div>, that usually prevents WP from adding paragraph tags.

    Also make sure you are using the Text instead of Visual editor, of course.

    Thread Starter cellendhyll

    (@cellendhyll)

    Thanks for your answer CrouchingBruin.

    In the end, I installed a plugin with the following code:

    <?php
    /*
    Plugin Name: Disable wpautop
    Plugin URI: https://www.urbangiraffe.com/plugins/disable-wpautop
    Description: Disables WordPress automatic paragraph formatting
    Author: John Godley
    Version: 1.0
    Author URI: https://www.urbangiraffe.com/
    */
    
    remove_filter ('the_content',  'wpautop');
    remove_filter ('comment_text', 'wpautop');
    remove_filter( 'the_excerpt', 'wpautop' );
    
    ?>

    I hope it will help someone.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress adding paragraphs tags’ is closed to new replies.