WordPress Plain Text Paste Plugin
This plugin adds buttons to the WordPress rich text editor (TinyMCE) for pasting in clipboard content as plain text.
Go ahead and take it for a spin. Extract nds-paste folder from the archive and copy it to wp-content/plugins.
nds-paste-0.2.zip
nds-paste-0.2.tar.gz
Developers note: You should be able to use this code to port other TinyMCE plugins into Wordpress as well. I had to use an older version of TinyMCE’s paste that did not call the addPlugin() function. Once I found a working version, the only thing required was adjusting the paths to hit the new directory.
I’d love to find a way to have this plugin hook into a CTRL+V keypress and open automatically. I believe FCKeditor provides this functionality. If anyone has any suggestions, let me know.
Reader Comments
Comments are closed for this post.
This was written on August, 31 2006 and is filed in code, wordpress.
Our Products
Categories
- portfolio
- code
- software
- company news
- trailmapping
- SEO
- wordpress
- presentation
- accessiblity
- subversion
- django
Archives
Elsewhere
What I’ve been up to online
-
Ever wanted to develop a real estate site, but didn't want to deal with the nuts & bolts? Now's your chance: http://premsites.com/developers
3 days, 6 hours ago # -
Core Shutdown
3 days, 13 hours ago # -
BackwardsIncompatibleChanges is my new best friend http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
2 weeks ago # -
@mtrier You'll be lucky to find good snow in Colorado or much of North America that early. Most resorts open around the end of November.
2 weeks, 2 days ago # -
My analytics account magically started working agiain today. Thanks lazy web. "A List Apart" link love! http://tinyurl.com/6r7oas
2 weeks, 6 days ago # -
Since I started using GAFYD, my Google Analytics account no longer works and Google won't respond to my emails. suggestions?
3 weeks ago # -
@twiderrific you have my vote for staying local
3 weeks ago # -
Django snippets: Super User Conditional Page Exception Reporting
debug page for superuser, 500 for everyone else
3 weeks, 6 days ago # -
Anybody want to split a hotel room for #DjangoCon?
4 weeks ago # -
Just got confirmation I'm on the invite list for #DjangoCon. Being a member does have its benefits. Couch surf or hotel?
4 weeks ago # -
Admin Image Widget
4 weeks ago # -
Follow @trailmapping for Trailmapping.com updates. Just pushed some slick jQuery into production tonight.
4 weeks ago # -
Munin :: com :: djangoproject.com :: trac_tickets
Graphs of trac tickets for Django
1 month ago # -
Automating tests in Django | Eric's Site
Generate tests by simply clicking through your development site.
1 month ago # -
Creator/updater fields for admin
1 month, 1 week ago #


Or have a look to the WIN32 Desktoptoll PureText => http://www.stevemiller.net/puretext/
Regards Thomas
Your plugin that allows WordPress to use the TinyMCE paste plugin worked great. Thanks!
I have added the plugin to the plugin directory and activated but it is not shwoing in the Rich Text Editor.
Using WP 2.04
Any ideas as to why it may not work in some situations?
This looks like a great plugin and very useful. Your help is much appreciated :)
JamesICT: What OS and browser combination are you using? I only tested it on a handful of browsers. Feel free to email me for support. We’ll be sure to post the fix here once we figure it out.
Hi Peter,
Windows XP Pro and Firefox 1.5.0.6
There is nothing too different in my setup really.
Thanks for helping :)
Nice job… My wife loves to edit in Word and it ALWAYS messed up the theme… This solves her problem and removes a clean up task I always got saddled with.
Mr Papa
The EditorMonkey plugin actually has a plugin for TinyMCE with it that has the paste as text function as well as a strip word formatting plugin. EditorMonkey is no longer being supported, but you may want to look at their code and incorporate the Strip Word Formatting option into this, since they are very similar.
http://www.rajprasad.net/plugins/editormonkey/
Excellent idea for a plugin, gonna add it asap. Thanks!
@Jaimie
The Word formatting button is already included :)
Well, Have u ever tried to press ALT+B in TinyMCE Editor in Wordpress? It DOES have this functionalities inside!
Paste From Word + Plain Text + Mess Clean Up
@Mani
I know the shortcut key functionality is there, I’m just looking for a way to hook into it without entirely replacing the existing rich text editor. IIRC, the code you’re referring to is part of the core functionality of TinyMCE and gets loaded well before the hook I used for this plugin.
BTW, after a few emails back and forth, we finally figured out JamesICT’s problem was that the plugin was loaded into the wrong directory. So no install issues to speak of so far. :)
Sorry , I correct.
ALT+B just works in WP 2.1 (Alpha) and Wordpress.com.
Oh, I see. In 2.0 ALT+b toggles bold text. I guess this plugin will be superceded by 2.1.
The feature you’re talking about looks pretty cool. http://engtech.wordpress.com/2006/09/03/wordpress-tips-alt-b/
This doesn’t seem to work with Mac OSX / Firefox. Is this expected behaviour, or is there a fix?
cheers!
John S., try clearing your cache. I don’t know what it is, but I just upgraded to the latest version of Firefox onto my Mac, and today have had to clear my cache several times when working on my blog. Once the cache was cleared, this plugin’s buttons were visible and usable to me.
Firefox menu -> Preferences -> Privacy -> Cache -> Clear Cache Now
Best of luck!
Question—do you have documentation for how to use these three buttons? Also, I do like to be able to use the little tooltext that normally comes up when you mouse over a button in the editor (like, you mouse over the “B”, and then a little yellow box pops up that says “Bold (Ctrl + B)”). When I mouse over the three buttons for your plugin, they come up with stuff like ”($lang_paste_text_desc)”.
Assuming this is not just a problem in my blog, can you fix those so the tooltext makes sense to the unitiated?
Thanks—I appreciate the plugin!
Ew Eek Ack, I should have tested further before posting.
I am on a Mac using OSX and Firefox 1.5.07, and wordpress 2.0.4 for my blog.
I installed your plugin. I can see the buttons. As noted above, the little tooltext is wrong. But even worse, when I click on any of the three buttons, instead of anything pasting into the page I’m editing, a new browser window pops up that is trying to reach the URL http://www.nkfreedomhouse.org/wp-content/plugins/nds-paste/paste/pastetext.htm . That causes a “404 not found” error. So, the plugin is completely not working for me.
Hope you can help!
@Sara
I didn’t write the script, I just hooked it into WP. So I don’t have any documentation. A Google search might turn up more info.
I see the correct tooltips on my system. Could you try in another browser to see if you are still having issues? I might not be able to look at that for a couple of days.
@Sara
You’re missing a couple of files there. Try re-uploading the plugin.
d’oh! gosh, thanks for the help, and I’m sorry for the confusion.
Great adaptation, I appreciate it.
@Sara
Thanks for the Firefox tip. Clearing the cache did indeed work. Now, if only TinyMCE worked in Safari…
Hi,
I’m having the same problem as JamesICT, that is the buttons don’t show in Wordpress rich text editor. I’m running WP2.04 on FF1.5.0.6 on Win XP-Pro, I also tested on IE6 and I get the same result. I’d really love this to work as I’m fed up with having to stip out all the crap form Word docs etc. when all I want is the text.
Hope you can help.
@Seoras
1. Clear your browser cache.
2. Make sure that you have uploaded the plugin correctly.
All the issues so for have been related to these two things.
Make sure that this URL works in your browser, replacing YOURDOMAIN.TLD with your own domain name.
http://YOURDOMAIN.TLD/wp-includes/js/tinymce/plugins/paste/../../../../../wp-content/plugins/nds-paste/paste/images/pasteword.gif
Peter,
thanks for the help, I manages to get it working although the problem was not the cache etc. (which I’d already looked at) but the clue was in the URL you supplied. I’d uploaded the nds-paste.php file and the paste folder seperately to the plugins folder instead of in the nds-paste folder. Thanks for the help.
Seoras
Would you mind sharing the solution for the problems JamesICT had and Seoras had with the buttons not showing up in the Rich Text Editor? I’m having the same problem. I’ve tried copying the “nds-paste” folder into wp-content/plugins/ and I’ve also tried copying the “paste” and nds-paste.php seperately into the plugins folder and neither is working for me.
Thanks for any help :)
Okay, nevermind…I found the solution for my problem. Here’s my fix.
The problem was that in line 30,31,33 referenced a “real-path” that was incorrect for my wordpress install. I have wordpress setup with the index.php in the root directory of my www domain and all other wordpress files in the wordpress directory. All I had to do was add /wordpress/ before the /wp-content on each line and that fixed it for me. Thanks for a great WP adaptation of this plugin – it helps me out greatly :)
@Darren
Try clearing your browser cache. If that doesn’t work, let me know what the uRL of your plugins folder is. I can take a look.
Nice plugin.
I’m hoping that a tip from http://tinymce.moxiecode.com/punbb/viewtopic.php?id=2077 will allow me to make ‘Post as plain text’ the only option for users :)
if (e.ctrlKey && e.keyCode == 86 && e.type != “keyup”) {
tinyMCE.execInstanceCommand(e.target.editorId, “mcePasteText”, true);
tinyMCE.cancelEvent(e);
return false;
}
I found your plugin via the wordpress help forums. I receive word files from other people to put on our church website. I have only processed one word table with it so far. It worked very well. I had used Steve Millar’s PureText to deal with word files before, but it could not deal with word tables this seems to. Thank you very much :-)
Thanks¡¡¡¡
You save my life :D, I have a client that messed up all the theme because he love Word
Now I´m happy and he is happy
I think it would be really helpful if you included a note in the readme about where to upload the “paste” folder. I don’t think less tech savvy users would ever figure out that they need to upload to
../wp-content/plugins/nds-paste/paste/images/pasteword.gif
-Rio
@Rio
The paste folder is within the nds-paste folder. The instructions say to upload the nds-paste folder into /wp-content/plugins. If you follow those directions, the paste folder will end up in the proper place, or am I missing something?
Apparently, I don’t know where to upload the files to.
I didn’t realize you have to upload the entire nds-paste folder..
Thanks for the plugin.
I noticed a problem if the paths to the files in your plugin differ. The following code should clear up the problem.
$pluginFile = dirname(FILE) . ”/paste/editor_plugin.js”;
$languageFile = dirname(FILE) . ”/paste/langs/” . $locale . ”.js”;
if (!file_exists($languageFile))
$languageFile = dirname(FILE) . ”/paste/langs/en.js”;
This is perfect for my HTML-challenged clients who love to just copy and paste from Word.
Great work and thanks for sharing with the World! You’ve saved me from hours of tidying up crappy style and class attributes.
For installing under WordPress MU (the multi-blog edition), the following might be helpful: http://mu.wordpress.org/forums/topic.php?id=2958
I just tested this plugin with 2.1beta 2, and it breaks the VRE. Well, doesn’t “break”, but the editor doesn’t show up at all. Deactivation returned the editor. Just an FYI.
Thanks for the update Michael. It seems this plugin isn’t needed as of 2.1. As Mani pointed out above, it is activated by pressing ALT+B.
Doesn’t work for me in WP2.1 either; I get the same problem as Michael B above: the visual editor just doesn’t appear anymore when this plugin (version 0.3) is activated. Refreshing doesn’t help.
In WP2.1 though, pressing ALT+SHIFT+V in Firefox (and ALT+V in IE7) while editing in the visual modus brings up TinyMCE’s advanced options toolbar – so I guess this plugin isn’t needed anymore for my setup. Now I only have to find a way to get that toolbar switched on by default.
@mark
You’ll find version 0.3 here. It is 2.1 compatible. There is also a link to it at the top of this page.
I’ve tested it in IE6, IE7, FF2.0, and Opera 9. Have you tried clearing out your cache? Do you have any other RTE plugins?
thanks so much!!!!!
I have found similar problem when I tried to installed them in the first time. I’m using wordpress 2.0.4 with Firefox 2.0 and I couldn’t find its button when I make my new post. but now I found solution for it. No need to clear browser cache or edit nds-paste.php You just need to upload them properly. You must upload “nds-paste” directory to wordpress plugins directory. Your upload path must be like this
http://www.domain.tld/wp-content/plugins/nds-paste/
and inside folder must have file and folder structure like this one.
nds-paste.php
/paste/
very, very useful plug-in, much appreciated. my only problem with the install was the need to change the pathways in lines 30, 31, 33 of the nds-paste.php file—may i humbly suggest you include a highlight of that at the top of the page.
I much appreciate this plug-in, but I have the problem that when I paste something with Ctrl+V, it paste it two times. Does anybody have an idea ?
Having installed the plugin, my visual editor fails to work atall now. I’ve deactivated the plugin, removed the folder, cleared my cache and re-installed WordPress. Visual editor still broken. Any ideas?
Jeremy
I have to apologise, the plugin causing the Editor to vanish was “My Page Order”, not your plugin.
Regards, Jeremy
v0.3 seems to be not backwards compatible. using v0.2 on wp2.0 did work.
thanks for the plugin
Hi there,
I have wordpress 2.2 and installed nds-paste. Once I activated it, I lost the native ‘visual’ editor in wordpress completely. This means that posts in edit mode are viewed as code. Any ideas how to fix? I’d understood that the Tinymce is the native rich text editor, so if ‘rich text editor’ is turned on in my profile (as it is) it should still be on.
@Sophia
You installed an old version that is not compatible with WP 2.2. Please see the link at the top of this post for a current version