If you, prefer to write in HTML directly, or in my case, Markdown, then you may have been plagued by WordPress’s annoying automatic adding of
p tags. After a while I was so annoyed that I decided to find a solution for it, and I found a very useful plugin called Raw HTML.
Getting it to Work
After installing and activating the plugin you can see it in action in a few ways:
A Part of Your Text
If you want to preserve a part of your text as is, then simply wrap it between [
raw] and [
/raw] shortcodes, or between
<!--/raw-->. If you use the second way then it means that if you ever uninstall the plugin then the shortcode would not suddenly appear in your posts, which makes it the better option.
When writing a post you should see the Raw HTML checkboxes on the right. You can just checkmark the options you want. The most important option is obviously, “Disable automatic paragraphs”!
This plugin is pretty lightweight and it doesn’t even have any settings. Then how can we make the default behaviour to stop automatically adding new paragraphs? Luckily the plugin’s FAQ had an answer.
Basically, just open the, “Screen Options” of any post editor by going to the top right when you are editing or making a new post. You should see a list of the Raw HTML checkmark options. Choose the options you want on by default.
That’s all there is to it. Thanks to Jans Elsts for this nifty plugin.