Raw HTML Plugin for WordPress
Introduction
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 put any code or script (e.g. JavaScript) in my posts and display it to the visitor unmodified.
Download & Installation
raw-html.zip (3 KB)
Requirements :
- WordPress 2.3.1 – 2.7
- Disable visual editor for better results – some characters (e.g. the ampersand) may still be encoded if it’s enabled.
Installation is straightforward – download the zip file, unzip, upload the raw-html folder to /wp-content/plugins and activate it in the Plugins tab.
Usage
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 “Write” screen (requires WP 2.5+) :

If you want to prevent a specific part of your post or page from being processed and “texturized” by WordPress, wrap it in <!–start_raw–>…<!–end_raw–> or [RAW]…[/RAW] tags. The two versions work exactly the same, but the latter may be handy if you’re using the visual editor (not recommended).
Example :
<!--start_raw-->
This
is
a 'test'!
<!--end_raw-->
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. If it works for you, consider yourself lucky
[...] Raw HTML. This WordPress plugin could come in handy. [...]
It seems Wordpress 2.5 doesn’t like the plugin. Will you be updating it?
I hope so
Thanks
Yes, I plan to eventually update all my plugins for WP 2.5. I’m working on the Single Click Updater plugin at the moment.
Thanks for the plugin.
We took a different approach to the vagaries of the Wordpress visual editor – which does terrible things to code of all times. Instead of fighting a losing war with the built-in WYSIWYG editor, we wrote a hardcore adaptation of FCK including an integrated image uploader-manager specifically for Wordpress.
We still do have some issues with trying to place straight code (particularly html code) within a post. After flipping back and forth between WYSIWYG and source, the angled brackets turn to html entities, like it or not. We’ll try to adapt your code to Foliopress WYSIWYG.
Looks like the WP 2.5 editor is a bit more flexible in this regard, though obviously not perfect. Anyway, good luck
Love this plugin. Would love to see 2.5 compatibility. Would also be interested in donation when it’s done.
Thanks
You’re welcome
By the way, have you tried using the current version in WP 2.5? I haven’t done in-depth testing, but it seems to work OK on my blogs that are running WordPress 2.5.
Guess I’ll have to finally put up a “Donate” button on the site.
Not yet, I’ll try it on a separate blog first. I’ve put too much work on my current one to screw it up.
Yes, I’d be happy to donate. Your plugin is exactly what I needed.
Test site looks good, I’ll convert to 2.5 sometime this weekend. Donation on its way, thanks again for the plugin!
Thank you
this is a critical plugin for my site, since all my posts use it, I’m terrified of upgrading to 2.5 and having things fall apart.
From the last comments in this thread, it sounds like you think it should work, have you come across any issues since you made that comment a couple of weeks ago.
I might take a crack at the 2.5 upgrade this weekend.
I’ve updated to 2.5.1 recently and the plugin seems to be working still.
Michael,
Same as you, all my post (112 of them) includes this plugin. I’ve converted to 2.5.1 and no problems at all. In fact it looks like 2.5 is a little more html-friendly. But I still require this plugin to work my blog.
I did create a test blog (seprate site) and tested it first before I converted. You should probably create a test blog too just to be safe.
So, if im trying to add in a youtube video will WP still reformat the objects?
I don’t know, I haven’t tried adding the videos directly (I used a plugin when I needed to insert a video). It would also depend on the WP version – 2.5 is said to be more forgiving in this regard.
Ive just come across your plugin, I’m using WP 2.5.1, because I need to add a few tables within my pages.
I did as instructed, unzipped, uploaded, activated and tried a simple table inclusion.
I used the ….. syntax and it worked a dream.
Brilliant plugin, thanks very much
Voddie
wow..nice plugin thanks
Cheers,
Online Issues
Hi all great information here and good thread to comment on.
Can I ask though – how did you get this picked up and into google news?
Very impressive that this blog is syndicated through Google and is it something that is just up to Google or you actively created?
Obviously this is a popular blog with great data so well done on your seo success..
Ah, so it’s in Google News? Interesting…
(or is the comment just very clever spam? in that case, congratulations, it works well
)
Tnx a lot for this plugin dude, it’s the best plugin I use on my blog!
btw, what’s the changes on 1.0.4?
@Hikari – Just a small bugfix in 1.0.4, no changes in functionality.
thanks for the raw html =)
שיש,שישלמטבח,שיש למטבחים
Hi,
I’m having some problems with this plugin. Posted a feedback here: http://wordpress.org/support/topic/187334?replies=1#post-798122
Using 1.0.4, also tested in new wordpress 2.5.1 installation with no other plugins.
Thanks a lot
[...] solution was simple with the help of yet another plugin. This time, I turned to Raw HTML from W-Shadow (see also the WordPress Official Plugins Directory page for Raw HTML. That plugin [...]
Great Blog…Looking to captilize from blogging as well.
Good plugin.
This is a nice plugin
Thanks…..