Ask your WordPress questions! Pay money and get answers fast! (more info)

Pasting from Word... WordPress

Hi Guys

I have a Word document which i have tried to paste into Wordpress using the paste from Word icon.

(** update** download doc here: http://www.stevewatsondemos.com/strange-format.docx)

usually this cleans up the text and the layout is fine. But with this particular text it does not clean up like it should

Can you take a look and explain whey this one is different.

The text was originally lifted from a web page (my client tells me)

Any insights, guidance or thoughts would be interesting to hear.

Many thanks
Steve

Answers (5)

2012-10-10

Sabby Sam answers:

HI,
try to paste that code in the notepad and the paste that code on wp editor.
It must work.

2012-10-10

Luis Abarca answers:

There no file attachment, but i always used to copy-n-paste to WordPad or another text editor.

could you upload the file ?


Luis Abarca comments:

You should paste in the HTML mode, the word has HTML content

2012-10-10

Dbranes answers:

when I paste the document (opened in Word 2003) into WP (via the Word filter) I get very large lines in the preview, fx:

The revered Ganga river dolphin will soon disappear from India‚Äôs longest river. Joydeep Gupta calls for urgent action against the perils of pollution and dwindling water flow and dangerous fishing techniques.


where   is used for space.

Pasting the code first into fx. the "Notepad" editor should clean all the format.

2012-10-10

Abdelhadi Touil answers:

For me I always remove formatting from document using word, then copy-paste to wordpress without any problem (paste directly to wordpress without using the word icon). here is how to remove formatting from a word document:
[[LINK href="http://help.isu.edu/index.php?action=knowledgebase&catid=38&subcatid=67&docid=673"]]http://help.isu.edu/index.php?action=knowledgebase&catid=38&subcatid=67&docid=673[[/LINK]]
Or sometimes I just copy from word and paste to notepad, then copy from notepad to Wordpress, but I prefer the first way because it maintains the basic formatting: paragraphes and unordored lists etc...
Good luck.

2012-10-11

Francisco Javier Carazo Gil answers:

You can delete HTML tags from Word with this code:

function cleanWordHTML($html) {
$html = ereg_replace("<(/)?(font|span|del|ins)[^>]*>","",$html);

$html = ereg_replace("<([^>]*)(class|lang|style|size|face)=("[^"]*"|'[^']*'|[^>]+)([^>]*)>","<\1>",$html);
$html = ereg_replace("<([^>]*)(class|lang|style|size|face)=("[^"]*"|'[^']*'|[^>]+)([^>]*)>","<\1>",$html);

return $html
}