How To Publish a Word Document to WordPress WITHOUT losing formatting
Apr 16, 2022 · 5 min read
Have you ever wanted to easily publish your Microsoft Word document or something similar directly to your wordpress blog, WITHOUT losing any formatting?
This is how to do it:
First, Edit your Microsoft Word Document in a newer version of Word such as Word 2016. Add formatting, anything you want. Here’s an example of a past coding article I created. This is how it looks in Word 2016:
You’ll see there is a lot of nicely formatted single space text and multi-colored nicely formatted source code, which I do not want to edit while trying to post the blog on wordpress. I normally post coding blogs, along with source code, and diagrams, and specially formatted objects within my document. I do NOT want to re-edit it all over again on another application! As, I’m sure you don’t want to either.
The next step is to Open your document in Google Docs at https://docs.google.com/ Signup for a google account if you don’t have one. Once you have logged into your google docs account, you need to open your word document directly by clicking on the open file picker:
Click on the Upload button and drag a file or select a file from your device to upload your MS Word document:
The next step is to download an HTML version of your MS word document that you just uploaded to Google Docs. Do NOT use MS Word to convert your document to HTML, as it adds a lot of unnecessary HTML, and you will lose all your hard work if you try it that way. So, just click the File menu and Select Download, then Web Page (.html, zipped) to save it as a zipped HTML file:
Next, open the .zip file, and extract it:
Open the HTML file with your favorite editor such as Notepad Or EditPlus:
Select all the HTML by typing CTRL-A and then Paste it directly into WordPress. Make sure you are in Code Editor Mode:
Make sure you do NOT edit the document in HTML mode (Unless you want to actually make changes at this point), and do not edit it in the Visual editor, as it will break any of your formatting that you had setup in your MS Word document originally.
Next, click Publish. Your document should be live, and be formatted exactly the same way as your Word document was:
. So, no changes need to be made, and there you have it, your document is published on WordPress!, Albeit with a bit of document conversion, but that is still a lot better than having to edit your document all over again in another editor or in WordPress directly. So, to recap:
- Once you have saved your Word Document, upload it to Google Docs (or skip MS Word altogether and create and edit directly on Google Docs.)
- Download the HTML version
- Paste the HTML into your Code editor on WordPress in your new Post
- Click publish
- Admire your hard work!