[Resolved] How do I prevent WordPress from adding br and p tags to my markup?

Home Forums Support [Resolved] How do I prevent WordPress from adding br and p tags to my markup?

Home Forums Support How do I prevent WordPress from adding br and p tags to my markup?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1828258
    Steve

    I’m using the old “sections” interface for a home page. When I add in some HTML using the “Text” interface, it typically gets messed up with br and p tags. I’ve tried a few plugins, and none of them worked. I tried adding the following code to functions.php and it worked for my case but broke everything else. Having a shortcode that allows you to enter raw pristine html sounded like a good idea.

    https://www.wpbeginner.com/wp-tutorials/how-to-disable-automatic-formatting-in-wordpress-posts/

    What solution (plugin or code change) do you recommend for allowing us to add HTML without the crazy auto formatting?

    Steve

    #1828998
    Elvin
    Staff
    Customer Support

    Hi Steve,

    This is one of the issues why the old “section” module was obsoleted. It’s simply a pain to deal with as it is old technology.

    But to help you out:

    Plugins like Raw HTML generally should be the answer to this. But you’ve already mentioned that you’ve tried plugins and it didn’t work, I’m not sure if anyone is still developing for this knowing Classic editor itself is obsolete as well. WordPress isn’t even planning to support if anymore as it’s end of life is on December 31, 2021.

    If I may suggest, try changing to the Block editor and just do parts that require HTML on a Custom HTML block.

    Note: The theme doesn’t control this. It’s a WordPress core function.

    #1830183
    Steve

    Hi Elvin,

    Thank you so much for the concise and helpful response. I understand that this isn’t a GeneratePress issue. You folks have just been so knowledgeable and helpful that I knew you’d have the answer.

    I’ll consider rewriting it all in blocks. Thanks for letting me know about the 12/31/2021 end-of-life for the classic editor.

    Best,

    Steve

    #1830280
    Elvin
    Staff
    Customer Support

    See the official announcement here –
    https://make.wordpress.org/core/2018/11/07/classic-editor-plugin-support-window/

    No problem. Glad to be of any help. 😀

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.