Raw HTML Plugin for WordPress


Recently I needed to put some style definitions and a JavaScript function in a post on another blog that I have. I wasted several hours trying to do this, because WordPress insisted on putting backslashes in front of my apostrophes, inserting superfluous <p> or <br /> tags in place of newlines, and generally breaking my HTML in various horrible ways.

In the end I decided to just go and write a plugin that would let me disable the automatic formatting that WordPress applies to post content. This plugin adds a set of shortcodes that you can use to “protect” specific parts of your post and prevent WP from messing with them.

Download & Installation

Requirements :

  • WordPress 2.8 or later
  • If you use the free version, I strongly recommend disabling the visual editor. It (the editor) can mess up your code even if you use this plugin.

Installation is straightforward – download the zip file, unzip, upload the raw-html folder to /wp-content/plugins and activate it in the Plugins tab.


There are two ways to use the plugin. First, to turn off “smart quotes” and other built-in filters for an entire post, use the checkboxes that Raw HTML adds to the “Edit Post” screen:

Raw HTML meta box screenshot

If you want to prevent a specific part of your post or page from being processed and “texturized” by WordPress, wrap it in ... or <!–raw–>…<!–/raw–> tags. The two versions work exactly the same, with one exception – the <!–raw–>’s won’t be visible to your visitors even if you deactivate the plugin.

Example :


a ‘test’!

Result :
This is a 'test'!

If you view the source code of this page, you will see that the newlines are still there, and the apostrophes haven’t been converted/escaped.

Other Notes

This plugin is provided AS IS, with no guarantee that it will work on your site.

Related posts :

308 Responses to “Raw HTML Plugin for WordPress”

  1. Chat4smile says:


    just want to say thanks about info that you have shared keep up the good work i really appreciate your effort thanks again

  2. Michael says:

    Thanks so much for this amazing plugin. Is it possible to change the default setting of having the checkmark selected for disabling automatic paragraphs?

  3. Michael says:

    I figured it out. For anyone else if you open the screen options, you can select which options will be ticked of by default.

  4. Martin Lacher says:

    It just doesn’t work. ๐Ÿ™ I’m using WordPress 5.5 and RAW 1.6.3 which is supposed to work 100%. I’m editing a page with Elementor. When I’m adding the tag in text mode, then edit some text in the preview window and update it, wordpress wraps tags AROUND the very tag – exactly what I wanted to prevent with this plugin! Therefore, sorry: worthless…

  5. This plugin was designed to be used with the classical post editor, the one that was the default in older WordPress versions and can be re-enabled with the Classic Editor plugin in WP 5.5. Unfortunately, it generally won’t work with any visual, third-party editors like Elementor, WPBakery Page Builder, and so on.

  6. Dostii4ever says:

    very nice ๐Ÿ˜€

Leave a Reply