I’d already come across a case where WordPress added <p>
tags. However now I’m dealing with the opposite situation. When I add [] shortcodes inside <p>
tags WordPress automatically removes <p>
tags.
<p>[anyshortcode]Hello World[/anyshortcode]</p>
Becomes:
Hello World
Adding dir=”ltr” to <p>
tags seems to fix the issue, maybe there is a way to add it programatically to all <p>
tags?
Any ideas on how to fix this?
This is pretty much what Foxsk8 mentioned in a comment, so credit should go to him, but these additional instructions will be useful. The WordPress plugin called TinyMCE Advanced will solve your problem.
This plugin comes with an option inside Settings > TinyMCE Advanced
that will fix your disappearing <p>
tags. Mark the checkbox labeled Stop removing the <p> and <br /> tags when saving and show them in the Text editor
and your <p>
tags will be preserved.