Why Pasting Word Into WordPress Breaks
Extra line breaks, missing spaces, broken tables, mso- styles in your HTML. Here is what actually happens when you paste from Word into WordPress, and how to stop it.
Strip the Office markup out of HTML pasted from Word, and keep the structure that matters.
Everything runs in your browser. Nothing you paste is uploaded.
Paste HTML that came out of Word, or out of an editor that took a Word paste, and it comes back without the Office markup. Headings, lists, tables, links and emphasis are kept. Everything describing how Word drew the page is removed.
There is no file upload and no library. Your browser already contains a complete HTML parser, and that is what does the work.
Word was built to describe a printed page, and its HTML export carries that history. When you copy from Word, the clipboard holds a full HTML document intended to be reopened by Word, complete with the information needed to reconstruct the layout exactly.
Most of that is useless anywhere else:
On a real document this is often most of the file. It is not unusual for cleaning to remove two thirds of the markup without touching a single word of the text.
The markup that actually breaks your page is not the Office tags, which browsers quietly ignore. It is the inline styles, which browsers obey.
Word writes font families, sizes, colours and margins directly onto elements. An inline style beats anything in your theme stylesheet, so pasted content keeps Word’s 11 point Calibri while the rest of your site uses your chosen font. The paste looks fine in the editor and wrong on the page, and no amount of theme customisation fixes it, because the problem is attached to the content rather than the design.
That is why stripping them is the default. If you turn the option off, the Office properties are still removed and the rest are kept, which is occasionally what you want when a table has deliberate column widths.
This tool cleans markup you already have. If you still have the original .docx file, you will get a better result by converting that instead, because the structure is intact in the file and has not yet been flattened by a trip through the clipboard.
Use our DOCX to Gutenberg tool for that. It reads the file directly and produces block markup rather than cleaned HTML.
And if the same cleaning happens every week, the honest answer is that neither browser tool is the right shape for the job. Both handle one thing at a time. The plugin runs inside WordPress and handles the whole pipeline, including the parts a browser tab cannot reach.
This markup reaches people by several routes, and the mess is the same in each:
That last one is worth checking if your site has posts that never look quite right. View the source of one and look for mso- or MsoNormal. It is very common on sites that have been running for a while.
Cleaning removes what should not be there. It cannot add back what was never there in the first place, and the difference matters.
If a heading was bold text in Word, it arrives as a bold paragraph and leaves as a bold paragraph. Nothing in the markup says it was meant to be a heading, so nothing can promote it to one. The same goes for lists made by typing dashes at the start of lines: they are paragraphs that begin with a dash, and they stay that way.
This is why converting the original file beats cleaning a paste. The .docx still knows which paragraphs are headings and which are list items. Once it has been through the clipboard, some of that is gone for good.
After cleaning, it is worth a quick look at what came back:
If the answer to the first two is no, cleaning has done its job and the document still has a structural problem. That is a document problem rather than a markup one, and our Word heading checker will tell you how widespread it is.
The output is plain HTML with no scripts and no external references. It is safe to paste into the WordPress code editor, a Custom HTML block, a static site generator, or an email template.
One caution: images. If the original markup referenced images by URL, those URLs are kept exactly as they were. If they pointed at a local file path on the machine Word was running on, they will be broken wherever you paste this, and no cleaner can fix that because the file was never anywhere a browser could reach.
Microsoft Office style properties beginning mso-, Office namespace tags such as o:p and v:shape, class names starting Mso, conditional comments meant for old versions of Internet Explorer, font tags, empty spans, and empty paragraphs. Optionally all inline styles as well.
Everything that carries meaning. Headings, paragraphs, ordered and unordered lists, tables, links, bold, italic and images all survive. The aim is to remove the description of how Word drew the page while keeping what the page says.
Usually yes, which is why it is on by default. Word inline styles are the most common reason pasted content looks wrong in a theme, since they override your site fonts and colours. Turn it off if you deliberately want to keep specific colours or alignment.
No. The cleaning runs in your browser using its own HTML parser. Nothing is uploaded, stored or logged.
Because HTML with nested tags and attributes containing angle brackets breaks pattern matching quickly, and Word produces plenty of both. This tool parses the HTML properly and walks the resulting tree, which is what your browser already does when it renders a page.
It fixes pasted markup. If you have the original .docx file, converting it directly gives a better result than cleaning up a paste, because the structure is still intact in the file. Our DOCX to Gutenberg tool does that.
Extra line breaks, missing spaces, broken tables, mso- styles in your HTML. Here is what actually happens when you paste from Word into WordPress, and how to stop it.
A step by step guide to getting a .docx file into WordPress with headings, lists, tables and images intact. Includes what to fix in Word first and how to check the result.
Copy-paste, Mammoth, manual rebuild, or a docx importer. An honest look at all four ways to move Word content into WordPress, including when each one is the wrong choice.
Done. Copy the cleaned HTML above.
This tool handles one document and gives you markup to paste. The DocxToWP plugin skips the copy and paste. It uploads your images to the Media Library as real attachments, fills your Yoast or Rank Math fields, and imports a hundred documents in one run.
The free plugin has no upload cap. Pro is $39 one-time and adds bulk import, scheduling and SEO fields.
Get Pro for $39 Lifetime access ends September 30 (30 days left)