• Home
  • Blog
  • Why you never copy and paste from MS Word

Why you never copy and paste from MS Word

on in Web and Social
  • Font size: Larger Smaller
  • Comments
  • Print

Whenever I build a website these days, I use the Joomla! Content Management System which comes with a WYSIWYG (What You See Is What You Get) editor for adding content. The large majority of sites built on a CMS (From Joomla! to SharePoint) have editors like this for easy addition of content by people who have no coding experience.

These editors are incredibly useful and very easy to use, offering users editing options similar to what you would see in Microsoft Word or other text editors. The problem is that many people will write their content in MS Word and then copy and paste into the editors on the website, unknowingly pasting additional code that could destroy the layout and styles of your website.

While there might not be any indication of trouble in the editor, viewing the HTML code itself (Many editors will allow you to view the HTML code) reveals a horrific disaster in code. In the most recent case there was ~4500 lines of code. After cleaning up all the extra code that came from Microsoft Office when the user copy and pasted, I was left with ~120 lines of code. On top of that, the content that was copied and pasted only accounted for 16 of those ~120 lines of code. Yeah. I wish I could say I was joking, but I'm not.

That's a LOT of extra code for a simple copy and paste. Many advanced editors offer a 'Paste as plain text' because of this specifically. If you are copy and pasting from any source other than the editor in your website, you should use this option to paste in your content. It will strip out any extra coding, and formatting, from the other source. Yes, this means you will have to reformat it, but remember, desktop publishing software and web layout are two very different beasts.

It's easier to write your content directly in the editor whenever possible. If you are working with a client, sometimes this isn't possible so you must remember to include the additional formatting costs into your quote. If, for some reason, your editor doesn't have this option built in, you can use a free online converter such as this one from WebToolHub (Many more options can be found using Google).

It took me about 10mins to clean up all the code in BBEdit, but I'm willing to bet whoever built the page spent quite a bit of time on trying to reformat the text with the editor (Judging by the sheer volume of unneeded div and spans littered throughout). You can save yourself, and others, a lot of time by using the paste as plain text whenever possible. If you work with a team of people on adding content to your website, also make sure they are aware of how to add content properly to your website. It would be terrible to have an inconsistent look and feel across your pages. Also remember that if you're planning on ranking well in search engines, having nice clean code also pleases the Google overlords! And it never hurts to please them.

Kray Mitchell hails from Calgary, Alberta, and is an educator at heart. Through speaking, workshops, consulting and training, he aims to assist people with understanding the technology that affects their day to day lives.
blog comments powered by Disqus
 Sometimes a teacher, always a student.  StopTheWWW Blue
Peek-a-Boo Kray
What's That Up There Kray
Kray Under Foot
Chillin' Like a Villan Kray