Remove paragraph tags before and after shortcodes

Home Forums Legacy Support Support queries How-to & Troubleshooting Remove paragraph tags before and after shortcodes

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #53348
    learner4life
    Participant
    Hi, I have noticed that many shortcodes such as heading, accordion, notes, also automatically include paragraph tags before and after. How can I remove these? for example, typically heading shortcode resolves into something like this < p > .... < / p> <h 3 class = " heading " > .. < / h 3 > < p > .... < / p>
    #53484
    MrVibe
    Keymaster
    Yes, and in some cases the P tags cause an issue such as the tabs shortcode. A quick fix is to remove these from the editor - text mode.
    #53530
    learner4life
    Participant
    Sometimes even that doesn't help. Especially if the two shortcodes are used back to back such as say [accordion]xyz[/accordion][heading]abc[/heading] the paragraph is somehow introduced in between or right after.
    #53658
    Anshuman Sahu
    Keymaster
    There is solution for this but this will apply Globally in the site . refer : https://codex.wordpress.org/Function_Reference/wpautop#Notes
    #53710
    learner4life
    Participant
    Thanks, I will give it a try.
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Remove paragraph tags before and after shortcodes’ is closed to new replies.