On device--:--
Log in

How to move text from Word to a website without junk code

Copy text from Word straight into a site editor and dozens of needless tags, fonts and indents come with it, breaking the look of the page. Here is how to get clean code in a minute.

Why text from Word spoils a page

Word keeps formatting inside the text itself: every paragraph gets the MsoNormal class, the Calibri font, a size, line spacing and indents. When such text lands on a website, these styles override the theme: the font is different, the size jumps, gaps open between paragraphs.

Clean HTML is content only: headings, paragraphs, lists, links, tables. How they look is decided by the site. That is the code you need.

Text editor: How to move text from Word to a website without junk code

Step 1. Paste the text

Copy the text in Word or Google Docs (Ctrl+A, then Ctrl+C), open the Tildekit text editor and press Ctrl+V. The editor notices the text came from Word and asks how it should go in.

Clean (standard) removes the junk at once and keeps headings, lists, tables and bold text. Mostly that is enough, and the remaining steps can be skipped. Keep formatting leaves the fonts and colours; choose it if you first want to see what will be removed.

The “Text from Word or Google Docs. How should it go in?” window with the options Clean (standard), Keep formatting and Text only
After Ctrl+V the editor asks how to paste the text.

The tool for this: Text editor

Step 2. Open the code next to the document

In the View menu choose Document and code, or press Both in the top right corner. The screen splits in two: the document on the left, its HTML on the right.

The View menu with the Document and code item highlighted
View → Document and code.

Step 3. See how much is needless

A counter such as “Can remove: 11 tags, 16 attributes” appears above the code, and the needless parts are marked in red in the code itself. These are styles, classes, and span and font tags that a website does not need.

Press Clean code.

The HTML code of text from Word: the junk counter and the Clean code button are highlighted
The junk counter and the Clean code button.

Step 4. Adjust the cleaning if needed

The Cleaning options button opens the list of what is removed. There are three presets: Light keeps more formatting, Standard suits most websites, Text only strips everything.

With the tick boxes you decide separately whether to remove links, images, bold and italic, blockquote quotes, and whether to keep alignment or text colour.

Cleaning options: the Light, Standard and Text only presets and tick boxes for tags and attributes
Cleaning options: presets and separate tick boxes.

Step 5. Copy the clean code into the CMS

After cleaning the counter changes to “Code is clean”. Press the copy button above the code and paste the HTML into the text mode of your CMS: in WordPress that is the Custom HTML block or the Code tab of the classic editor.

If you do not like the result, press Undo in the notice or Ctrl+Z: the formatting comes back.

Clean HTML after cleaning: the copy button is highlighted
Clean code and the copy button.

Tip. Upload pictures from Word to the site separately, through the media library of the CMS, instead of carrying them over with the code.

Questions and answers

Will headings and lists survive?

Yes. Standard cleaning keeps headings, paragraphs, bulleted and numbered lists, tables, links, bold and italic. Only styles, classes and service tags are removed.

What if the text is from Google Docs?

It works the same way: Google Docs also adds many span tags with styles, and the editor removes them.

Can I clean ready-made HTML code rather than text?

Yes. Switch to Code, paste your HTML into the box and press Clean code.

Read next

TextTildekit text editor: a full reviewTextHow to make an automatic table of contents with page numbersTextHow to format an essay or a course paper online