WP AI Internal Linker
AI suggests the most relevant internal links while editing a WordPress post. Insert with one click in Gutenberg or Classic Editor.
by Bilal Mahmood · github.com/sahibbilal/wp-ai-internal-linker · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/sahibbilal/wp-ai-internal-linker/archive/refs/heads/master.zipReadme
WP AI Internal Linker
AI suggests the most relevant internal links while you're editing a post. Insert them with one click.
WP AI Internal Linker reads your post content, scans your entire site, and uses Claude AI to find which of your other posts would make the best internal links — and exactly which phrase in your content should become the anchor text.
What It Does
- Meta box in the post editor (sidebar) — available in both Gutenberg and Classic Editor
- ✨ Suggest Internal Links button — Claude reads your post and your site's content pool, returns the most relevant links
- Suggested anchor text — Claude picks the specific phrase from your post that should become the link (not just the post title)
- Reason per suggestion — one sentence explaining why this link adds value for readers
- ↪ Insert Link button — finds the anchor phrase in your content and wraps it in a link; if not found, appends a "Related:" paragraph
- View ↗ button — open the target post in a new tab to verify
- Works with Gutenberg (
wp.data.dispatch) and Classic Editor (TinyMCE) - Configurable max suggestions (1–10) and post types
File Structure
wp-ai-internal-linker/
├── wp-ai-internal-linker.php # Bootstrap
├── includes/
│ ├── class-suggester.php # Claude API — reads post + candidate pool, returns suggestions
│ ├── class-meta-box.php # Meta box registration, AJAX handler
│ └── class-settings.php # Settings page (API key, max suggestions, post types)
├── assets/
│ ├── meta-box.css
│ └── meta-box.js # Gutenberg + Classic Editor insertion logic
└── README.md
Installation
- Upload
wp-ai-internal-linkerto/wp-content/plugins/ - Activate
- Go to Internal Linker → Settings and add your Claude API key
- Open any post or page in the editor
- Find the 🔗 AI Internal Linker panel in the sidebar
- Click ✨ Suggest Internal Links
How It Works
- You click the button — the plugin sends your post title + content summary to Claude
- Claude also receives a list of up to 80 other published posts (title + excerpt)
- Claude picks the most topically relevant ones and suggests a natural anchor text phrase from your current content
- Suggestions appear as cards: target post title, anchor text, and reason
- Click ↪ Insert Link — the plugin finds that phrase in your editor and wraps it with an
<a>tag
API Cost
- Model:
claude-haiku-4-5 - ~$0.002–$0.005 per suggestion run (slightly larger prompt due to candidate list)
- Very low — a team doing 50 posts/month ≈ $0.25
Part of the 30-Day WordPress AI Plugin Series
Day 7 of building one open-source WordPress + AI plugin every day.
Follow along: bilalmahmood.dev
License
GPLv2 or later