I incorrectly assumed that it was common knowledge to not paste content from the microsoft office suite directly into the WordPress Visual editor but I encounter problems related to this issue so frequently that I thought I should do a quick write-up about the issue.
When you copy and paste content from Microsoft Word, it attempts to preserve the formatting and adds sorts of “ugly” formatting code into the WordPress editor. Frequently this results in the page not displaying properly in Internet Explorer. (It amuses me to no end that Microsoft’s web browser can’t deal with it’s Word Processor formatting code. For some reason Firefox is able to work around it.) So, someone will come to me and tell me that the formatting on the page is messed up or that the sidebar is in the wrong location. It isn’t actually a layout or WordPress code issue but rather that formatting code from Microsoft Word is affecting the layout.
When you use the Visual Editor you won’t see the formatting code. You can, however, determine if this is the problem by switching to the html editor or viewing the source code in the web browser. If you see code that looks like the following, then you can be confident that the Microsoft Word formatting is the cause of the problem.
<p class="MsoNormal" style="margin: 0in 0in 10pt;"> <span style="font-size: small;">Some text here.</span> <span style="mso-spacerun: yes;"> Some more text here. </span> <span style="mso-spacerun: yes;">And some more. </span>
The class and styles that start with Mso giveaway that the content was pasted directly from Microsoft Word. If that class and span information is removed, the formatting problem is corrected.
So, what do you do if you have a lot of content in Word that you want to post on your WordPress site?
- Use the paste from Word button the toolbar. You need to click on the Kitchen Sink button to see it.
- Paste the Word content into a text editor like Notepad and then copy and paste it into WordPress.
Have you ever run into this type of formatting problem? Personally I haven’t because I don’t use Microsoft Office and I don’t use the Visual Editor but I encounter this issue almost weekly.
photo credit: SierraBlair