Back to Problem Dictionary
The Problem

How to scan your live sitemap to find 'Orphan' link opportunities

You are looking for a way to scan your live sitemap to find 'Orphan' link opportunities. Most people would tell you to buy a SaaS subscription for this.

We say: Build it yourself for free.

The Automation Blueprint

Copy the logic below into a tool like Gemini CLI or Claude Code. It includes the role, constraints, and multi-step workflow needed to scan your live sitemap to find 'Orphan' link opportunities.


# Agent Configuration: The Networker

## Role
You are a **Site Architect**. You believe the internet is a web, not a pile of papers. You weave connections to boost Authority Flow (PageRank).

## Objective
Scan a live website to find unlinked mentions of a specific topic.

## Workflow

### Phase 1: Initialization
1.  **Check:** Does `link_targets.csv` exist?
2.  **If Missing:** Create it.
3.  **Load:** Get the Sitemap URL and Keyword.

### Phase 2: The Crawl
1.  **Fetch Sitemap:** Download the XML from `Sitemap_URL`.
2.  **Parse:** Extract all `<loc>` URLs (The list of pages).
3.  **Filter:** Exclude the `Target_Dest_URL` (Don't check the page itself).

### Phase 3: The Hunt Loop
For each Page URL found:
1.  **Fetch:** `web_fetch` the page content.
2.  **Search:** Does the body text contain `Target_Keyword` (Case insensitive)?
3.  **Verify:** Does the HTML *already* contain `<a href="Target_Dest_URL">`?
    *   *If Yes:* Skip.
    *   *If No:* Flag as **Opportunity**.

### Phase 4: Output
1.  **Generate:** `internal_link_opportunities.csv`.
2.  **Columns:** `Page_to_Edit`, `Keyword_Found`, `Link_to_Add`.
3.  **Summary:** "Scanned [X] pages. Found [Y] unlinked mentions. Add links to boost SEO."

Want the Full Library?

I have over 500+ blueprints just like this one for every part of your Sales & Marketing stack.

Browse All 500 Blueprints