Three ways a Word document loses its links before it reaches your CMS

Five articles I published went live with their links stripped, and my own check told me there had never been any. These are the three ways it happens and the one check that settles it.

By · Tips ·

In August, five articles I published went live with their links stripped out. They'd arrived as Word documents, the script I use to turn a document into HTML had dropped the links without any error, and when I checked whether the articles had links in them, I checked the HTML the script had produced and concluded there were none. Nine days later I did it again with a different file, and that time I emailed the writer to ask her to send the links she'd forgotten. She'd put four in.

There are three ways a Word document loses its links on the way into a CMS, I've hit all of them, and none of them shows up unless you look in the right file.

Where the links are in a Word document

A .docx file is a zip archive with several XML files inside it. The text of the article is in one file, and you'd expect the links to be in there with it, but they aren't. The text only holds a reference, something like “this phrase is link number 7”, and the web addresses themselves are kept in a separate relationships file in a different folder.

So, any tool that converts the document has to read both files and join them up, and each of the three failures is a way that join breaks. When it breaks, the phrase comes through as ordinary text and the article reads perfectly well.

The three ways

The relationships file isn't written in the order you expect. Each entry has an ID and a target address. My script assumed the ID came first. Some programs that export Word documents write the target first. The script found no matches, built an empty list of links, and turned every link in the article into plain text.

The main file isn't always called the same thing. The body of a Word document is normally in a file called document.xml, and my script assumed it always was. In the batch that caught me, it was called document2.xml, and its relationships file was named to match. A tool that looks for the usual name finds nothing, or finds the wrong thing.

The link tag isn't always written the same way. In the second incident, the file's link IDs were long random strings and not the short numbered ones I was used to, and the ID wasn't the first attribute on the tag. My check looked for the tag with the ID straight after it, matched nothing, and reported that the document contained no links.

There are two smaller ones that don't lose the link but spoil the article. Text inside a Word file is already encoded for XML, so if your tool encodes it again, every “&” in a company name is published as “&”. And some writers set the whole document in bold as their base style, which comes through as a wall of bold unless you only keep bold where it marks part of a paragraph.

How I fooled myself twice

The first time, I tested the output. The converted HTML had no links in it, so my check said the article had no links, which was true of the HTML and false of the document.

The second time, I did go back to the source, and I used two quick commands that both gave me a confident wrong answer. One searched the body file for “http” and found nothing, because the addresses are never in the body file. The other was a one-line pattern over the relationships file, and since that file is a single long line, the pattern swallowed all the entries and printed one result that looked like a clean answer.

On the strength of that, I wrote to the writer and asked for her links. I shouldn't have sent that email off the back of my own script. A writer who has gone to the trouble of sending an article is very unlikely to have left the links out, and that alone should have made me check again.

The check that works

Rename a copy of the file from .docx to .zip and open it. In the word folder there's a folder called _rels, and in that there's a file ending in .rels that matches the name of the main document. Open it in a text editor and search for TargetMode="External". Every entry with that on it is a link the writer added, with its address in the Target. If that file has addresses in it and your published article doesn't, your tool is the problem.

It takes about a minute, and it's now the only thing I accept as proof that a document has no links.

The time the link was there and nobody could see it

In September I was told an article on one of my news sites had no links in it. This time the HTML was right, and both links were in the page source with their addresses.

The cause was the theme. It had a setting for how links look inside an article, with the choices being none, a colour or an underline, and it was set to none, so links were the same colour and weight as the text around them. A reader had no way to know they were there. I changed it to underline, which fixed every article on the site at once.

Google would have been fine with them as they were. Its link best practices page says “Generally, Google can only crawl your link if it's an <a> HTML element (also known as anchor element) with an href attribute”, and these were exactly that. A link no reader can find won't get clicked, though, and a person checking the page by eye will report it as missing, which is what happened.

Google's link best practices page: Generally, Google can only crawl your link if it's an a HTML element (also known as anchor element) with an href attribute.
The sentence on Google's link best practices page, highlighted. Google Search Central: Link best practices for Google (developers.google.com/search/docs/crawling-indexing/links-crawlable), captured 1 December 2026.

That theme also puts a line break between the opening of the link tag and its address, which means a simple search of the page source for a link tag followed by an address on the same line finds nothing. So, I had a page where the links were invisible to a reader and to my own quick check, and visible to Google.

What I'd do

In this order, because each step looks one layer closer to what the reader sees, and you want to know which layer lost the link:

  1. Count the links in the source document using the relationships file, and write the number down.
  2. Count the links in the HTML you're about to publish. If the two numbers differ, stop and fix the conversion.
  3. After publishing, view the page source and count them again, searching for the addresses themselves and not for a tag pattern.
  4. Look at the page as a reader and check you can tell where the links are without hovering.
  5. Only then ask the writer, and only if step one found none.

There's more on links on the link building page.

This post sits under link building in the knowledge base, which is where I set out what Google says on it and what the published studies found. The rest of what happened on my own sites is on the blog.