Three Ways to Avoid Hidden Code When You Copy / Paste into Your Blog • New Tricks
 In WordPress

Newbies bloggers beware. You may be creating validation or formatting problems in your blog posts and not even realize it by falling into a little discussed bad habit known to wreck havoc. Usually you will be writing a post directly into the WordPress edit window when adding a Post or a Page. But for longer posts or articles that you are writing you may use a word processing program like Microsoft Word or from time to time you will need to copy something from another website.

A good rule of thumb is not to copy and paste directly from Word or from another web page in order to avoid hidden, unnecessary (and often out of date and harmful) CSS styles and HTML tags that may be lurking in the copied material. The tricky thing is that you may not even know there is a problem until one day you can’t update your version of  WordPress and someone suggests running it through a validation editor and you find 276 errors! Does that sound like the voice of experience? uh huh… You won’t have this problem if you do your posts directly into WordPress but on the occasions that you do need to copy / paste I have listed three ways to avoid creating problems when doing so.

  1. When in the edit box click on the “Kitchen Sink” button to show more options, choose Paste as Plain Text (Paste from Word removes only some of the bad code, not all of it) then paste your text there. You will lose simple styling such as bold text or links, but this is not necessarily a bad thing. Reformat your text with the WordPress WYSIWYG ( what you see is what you get) editor.
  2. If you have Dreamweaver (other WYSIWYG editors might work too), paste the text you have copied from word or a web page into Design View, then go into the Code View window and copy the text from there. Click the HTML tab in the WordPress editor and paste the text there. This will remove any superfluous markup.
  3. Paste the text into Windows Notepad and save it as a txt. file. Then you can copy it from the .txt file and paste it into WordPress.

Don’t worry that you have been copy/pasting with wild abandon, you can check for errors by going to the site You will see a listing for a HTML Validator and a CSS Validator. Select each one of these and put in your blog URL to have it search for errors. It will also show you where they are located so you can go back and fix them on your site.

Recent Posts

Leave a Comment