• The Widget Shortcode Block Adds Paragraph Tags! Why? This should not add any formatting because the formatting should be handled by the shortcode’s output. Please consider fixing this.

    Anyone having trouble with this? Just switch to using the custom html widget and paste your shortcode there. No formatting added by wordpress….

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @sgumby ,

    It seems you need to disable the wpautop

    add the following code in your functions.php file. This will resolve your issue.

    remove_filter('the_content', 'wpautop');

    Thread Starter sgumby

    (@sgumby)

    Right but doesn’t that disable it for all content output? That’s not really a solution.

    • This reply was modified 1 year, 7 months ago by sgumby.

    “Custom HTML” block doesn’t fix the issue for me, <p> tags are spawned around my divs echoed by the shortcode.

    Only way I found to get rid of random Ps for good is to install and activate the “Classic Widgets” plugin so to get rid of Blocks entirely and use a Text widget in the widgets area to hold the shortcode.

    This is a drastic workaround because it disables the block editor for widgets entirerly.

    Thread Starter sgumby

    (@sgumby)

    I’m surprised Custom HTML didn’t work for you. I feel like there’s got to be an other x factor in your instance. I suspect that filters can be added to blocks and so maybe your theme is adding an extra filter to all blocks that is doing that. What theme are you using?

    • This reply was modified 1 year, 5 months ago by sgumby.

    This is hilarious, about 6 hours of trying, none worked for me. Why add extra tags to the shortcodes output! Let the shortcode handle it. Anyone got a solution? Please revert the change @wordpress Core Team.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Widget Shortcode Block Adds Paragraph Tags’ is closed to new replies.