Shopify Bulk Internal Link Editor (Google Colab)
Adding an internal link to one product description is two clicks. Adding a hundred approved links to the right sentences across products, collections and blog posts, without breaking anything, is a different job. This free Google Colab notebook does it through Shopify’s GraphQL Admin API: it exports every body, shows each change as a diff, and only saves when you say so, with a backup, a log and a rollback.
Who it’s for
SEOs and store teams who already have a reviewed list of internal links to add, one row per link with the page, the anchor and the target, and who can install an app on the store with Admin API access. You don’t need to write code; you edit a settings cell and run the cells in order.
How to use it
- Open the notebook and run every cell with sample mode on. It runs end to end on a mock tea shop, including a write and a rollback, with no store and no key.
- Add your link menu CSV. Only rows with status approved are used.
- Add your Admin API token, or an app’s client ID and secret, as Colab secrets. The notebook never stores them in a file.
- Run the export and the dry run. Read the diff: each row says whether the link would go in, or why it was skipped.
- Set the write switch on, with a small limit for the first batch, and run the write cell.
- Check the receipt and the page source of one or two pages. If anything looks wrong, run the rollback cell.
What you get
- An export of every product, collection and article body as a CSV
- Links placed on the first plain-text mention of the anchor inside a paragraph or list item, never inside an existing link, a heading, a button or code, and never a page to itself
- A re-read before every save that skips any item edited since the export, and a check of the API’s userErrors
- A backup per item, a log of every run and your menu rows marked applied with a date
- A rollback that restores the newest backup, refuses to overwrite later edits unless you force it, and backs up what it replaces
In the sample run, 12 approved rows gave 8 links in 6 items. Two anchors were skipped (one only appeared on a button), one page already linked to the target and one row was a Shopify page, which the editor doesn’t cover.
Limits
The live API calls are built from Shopify’s 2026-10 GraphQL reference and tested only against mocked responses in the documented shapes, so start on a development store or two or three items. The Admin API is free to call and rate-limited; the notebook pauses when it runs low. Shopify pages and translations aren’t covered.
Read the companion guide, Shopify internal linking: where links live and how to add them, and build the approved link menu this notebook expects in AI-powered Internal Linking Audit and Automation.
What’s included
- Exports every product, collection and article body with Shopify's bulk operations
- Links the first plain-text mention of each approved anchor, never inside a link, heading or button
- Dry run by default: a diff per change, and a reason for every skipped row
- Skips items edited since the export, keeps a backup per item and a log of every run
- Rollback cell that won't overwrite later edits, plus a sample mode that needs no store
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 73 coding script or notebook resources →

