Rich Text Internal Links Cheat Sheet: Contentful, Sanity and Storyblok
In a headless CMS, a link inside the body text is stored as data that points at another entry. It only becomes an <a href> that search engines can follow when your front end resolves it, and the default renderers don’t always do that. This free two-page cheat sheet shows how Contentful, Sanity and Storyblok each store an in-body internal link, how to turn it into a real link, and where each one goes wrong out of the box. It comes with small resolver code and tests on GitHub.
Who it’s for
SEOs, content leads and developers working on a headless or static site who want to know whether the links editors add in the CMS actually reach the page, and how to add more of them safely. You don’t need to write code to use the PDF; the code is there for whoever builds the front end.
How to use it
- Read page 1 for your CMS: what the link looks like in the JSON, how to fetch its target, how to render it, and the default trap.
- Pick a page you know has a body link and check that the link is in the HTML your server sends. The cheat sheet gives the one-line
curlcheck. - If the link is missing, give the developer the renderer fix for your CMS. The GitHub folder has it for each official renderer, and as a zero-dependency resolver.
- Run
node audit.tson an export of your posts to list every rich-text link with the href it gets and whether it resolved. - Before adding links in bulk, use page 2: where else links live, the management API calls, the six checks before any write-back, and how to check the built HTML in CI.
What you get
- A two-page PDF: a side-by-side of the three CMSs, plus write-back and checking routines
- Resolvers for Contentful
entry-hyperlinknodes, SanityinternalLinkannotations and Storyblok story links, in TypeScript that Node runs directly - The same fix written for each official renderer, with tests that show the default output next to the fixed one
- A link audit that writes one CSV row per link: anchor, target, href and status
- A write-back dry run that adds approved links as nodes or marks, prints a before and after, and keeps backups and an undo log
Limits
The default behaviour was checked on 5 December 2026 with @contentful/rich-text-html-renderer 17.2.3, @portabletext/to-html 6.0.0 and @storyblok/richtext 5.5.2, on sample data shaped like each documented API response. No live CMS space was used, and the management API calls on page 2 come from each CMS’s documentation, so try them on one draft entry first. Field and annotation names vary by project: check your own schema. The write-back script prepares changes and never sends them.
Read the companion guide on headless CMS internal linking, and learn the full build, from a scored link menu to links shipped with dry runs and undo logs, in AI-powered Internal Linking Audit and Automation.
What’s included
- How Contentful entry-hyperlink nodes, Sanity internalLink annotations and Storyblok story links are stored and resolved
- The default trap in each official renderer, tested: a debug span, an unknown-mark span, a relative link
- The renderer fix for each CMS, plus zero-dependency resolvers and 28 tests on sample data
- A link audit CSV per body: anchor, target, href and status (ok, unresolved, no route, fallback)
- A write-back dry run with backups and an undo log, and the management API calls to send it
Where this resource is used on MLforSEO
Walkthroughs on the blog
Concepts behind it
More internal linking resources
- Coding Script or NotebookLink Blocks for WordPress: Related Posts, Topic Cards, Siblings and Mentions
- Coding Script or NotebookLink Menu to Linking Rules: Python Script for Auto-linking Plugins
- ChecklistBefore You Build: A Checklist for Internal Linking Tools
- Coding Script or NotebookInternal Linking QA and Holdout Group Notebook
- Visualization TemplateInternal Linking Impact Dashboard (Data Studio Template) with Setup Guide
- Coding Script or NotebookInternal Link Menu Notebook: Priority Score and Versioned Recommendations
See all 26 internal linking resources →See all 15 guide resources →
