AI Semantic Internal Links by WebGeeksMedia

Description

AI Semantic Internal Links suggests internal links inside the WordPress editor based on what a passage means, beyond plain keyword overlap. Each post becomes a 768-dimensional vector embedding (Google Vertex AI text-embedding-005), the vectors live in your own Pinecone index, and similarity search finds the posts that best match each phrase.

The plugin also exposes a Related Posts function, ilsej_get_related_posts(), that a theme can call to show related posts chosen by meaning instead of shared tags.

How it works

  1. Indexing: each post’s title and a short extract of its text are turned into a vector by Google Vertex AI and stored in Pinecone with the post’s title, URL, date, primary category, tags and post type.
  2. Suggestions: in the editor, Bulk Auto Suggestion asks an extraction model (Claude or OpenAI) to pick linkable phrases from the post, then finds the closest indexed posts for each phrase. Anchor mode skips the extraction model and searches for the text you selected.
  3. Editor UI: suggestions appear in a sidebar (Gutenberg) or a panel (Classic Editor). One click inserts the link.
  4. Background sync: WP-Cron updates the index when a post is published, updated, unpublished or deleted.

Features

  • Suggestions by meaning: finds topically related posts even when they share no keywords, tags or categories.
  • Both editors: Classic Editor (TinyMCE) and the block editor (Gutenberg).
  • Anchor checks: drops suggestions whose anchor names a brand, product or identifier the target post never mentions, and generic one-word anchors that do not match the target.
  • Related Posts function: ilsej_get_related_posts() returns related posts through a Pinecone query by post ID, cached per post.
  • Index status: a live “X of Y posts indexed” bar on the Articles Indexing page.
  • Filters: limit suggestions by category, tag, post type or age; exclude whole categories or tags in Settings.
  • Relevance threshold: a minimum similarity score hides weak matches.
  • Duplicate filter: hides suggestions for URLs already linked in the post.
  • Primary and fallback extraction provider: choose Claude or OpenAI as the primary, the other (or none) as the fallback.
  • Encrypted API keys: stored with AES-256-CBC, keyed to your site’s salts.
  • Rate limiting and retries: a rate limiter for indexing requests and retries with exponential backoff.
  • Bulk indexing: index an existing archive in batches with progress tracking.

What you need

  • A Pinecone account and index (768 dimensions, cosine metric).
  • A Google Cloud service account with Vertex AI enabled, for embeddings.
  • An Anthropic API key, an OpenAI API key, or both, for phrase extraction.

Each service bills you directly under your own account. The plugin adds no fees of its own.

Credits

AI Semantic Internal Links is based on the original AI-powered internal linking plugin by Vahan Petrosyan, published by Search Engine Journal under the GPL-2.0-or-later license (archived article). Thank you to Vahan for the original design and code.

External services

This plugin connects to the four third-party services below. It sends nothing to any of them until you enter that service’s credentials in Internal Linking > Settings. Each request goes from your server to the service, never from the visitor’s browser.

Google Vertex AI (Google Cloud)

Used to turn text into vector embeddings.

  • What is sent: when a post is indexed, its title and a short extract (the SEO meta description if Yoast SEO is active, the excerpt, the first paragraph, each H2 heading with the paragraph after it, and the last sentence); short phrases with their surrounding sentence when an editor asks for suggestions; the selected text in anchor mode; and any search text your theme passes to ilsej_get_embeddings(). To authenticate, the plugin signs a token request with your service account key and sends it to Google’s OAuth endpoint; it also does this once when you save the key, to check it.
  • When: on bulk indexing, when a post is published or updated (through WP-Cron), when an editor asks for suggestions, and when your theme calls the embedding or search functions.
  • Endpoints: https://oauth2.googleapis.com/token and https://<region>-aiplatform.googleapis.com/.
  • Google Cloud terms: https://cloud.google.com/terms
  • Google Cloud Privacy Notice: https://cloud.google.com/terms/cloud-privacy-notice

Pinecone

Used to store the vectors and search them.

  • What is sent: each indexed post’s vector, its post ID, and metadata (title, URL, publish date and year, primary category, tags, post type); search vectors and filters when suggestions or related posts are requested; delete requests when a post is unpublished, deleted or leaves an indexed post type. When you save your API key, the plugin checks it against Pinecone’s index list, and the Articles Indexing page reads your index’s vector count from its describe_index_stats endpoint.
  • When: on indexing, on post updates and deletions, when an editor asks for suggestions, and when your theme calls ilsej_get_related_posts() (results are cached).
  • Endpoints: your index host (https://<your-index>.svc.<region>.pinecone.io) and https://api.pinecone.io/.
  • Pinecone terms of service: https://www.pinecone.io/legal/
  • Pinecone privacy policy: https://www.pinecone.io/privacy/

Anthropic (Claude)

Used to extract linkable phrases from a post when Claude is the primary or fallback extraction provider.

  • What is sent: the post’s text with formatting reduced to basic structural tags (headings, paragraphs, lists, tables, quotes, links and emphasis; scripts, styles, images and attributes are removed), plus the extraction instructions. When you save your API key, the plugin checks it against Anthropic’s model list.
  • When: only when an editor clicks Bulk Auto Suggestion in the editor and Claude is the primary provider, or Claude is the fallback and the primary failed.
  • Endpoints: https://api.anthropic.com/v1/messages and https://api.anthropic.com/v1/models.
  • Anthropic commercial terms: https://www.anthropic.com/legal/commercial-terms
  • Anthropic privacy policy: https://www.anthropic.com/legal/privacy

OpenAI

Used to extract linkable phrases from a post when OpenAI is the primary or fallback extraction provider.

  • What is sent: the same reduced post text and extraction instructions as above. When you save your API key, the plugin checks it against OpenAI’s model list.
  • When: only when an editor clicks Bulk Auto Suggestion and OpenAI is the primary provider, or OpenAI is the fallback and the primary failed.
  • Endpoints: https://api.openai.com/v1/chat/completions and https://api.openai.com/v1/models.
  • OpenAI terms of use: https://openai.com/policies/terms-of-use/
  • OpenAI privacy policy: https://openai.com/policies/privacy-policy/

About the fallback provider

When a fallback provider is set and the primary fails (no key, an error, a timeout, a refusal or an unusable answer), the same post text is sent to the fallback provider as well. Set the fallback to “None” if a post should only ever reach one extraction provider.

Screenshots

Installation

Before you start, you need:

  • A Pinecone account (pinecone.io) for storing the vectors.
  • A Google Cloud project with billing turned on, for Vertex AI embeddings.
  • An Anthropic API key, an OpenAI API key, or both, for picking anchor phrases.

Setup takes about 15 minutes. Follow the steps in order.

Step 1: Install and activate the plugin

  1. In WordPress, go to Plugins > Add New Plugin and search for “AI Semantic Internal Links”.
  2. Click Install Now, then Activate.

You can also upload the zip through Plugins > Add New Plugin > Upload Plugin.

Step 2: Create a Pinecone index

  1. Sign in at app.pinecone.io and create a new index.
  2. Set Dimensions to 768 and Metric to cosine. Other values do not match the embeddings this plugin creates, so indexing will fail.
  3. Open the new index and copy its Host URL, shown at the top of the index page. It starts with https:// and ends with pinecone.io.
  4. Go to API Keys, create a key and copy it.

Step 3: Create a Google Cloud service account key

  1. Open console.cloud.google.com and select or create a project. Billing must be turned on for that project.
  2. Go to APIs & Services > Library, search for Vertex AI API and click Enable.
  3. Go to IAM & Admin > Service Accounts and click Create service account. Give it the Vertex AI User role.
  4. Open the new service account, go to Keys > Add key > Create new key, choose JSON and click Create. A .json file downloads. Keep it private: anyone with this file can use your Google Cloud project.

Step 4: Get an AI key for phrase extraction

Create an Anthropic key at console.anthropic.com or an OpenAI key at platform.openai.com/api-keys. One is enough. If you add both, the second one is used when the first fails.

Step 5: Enter your keys in WordPress

Go to Internal Linking > Settings and fill in:

  1. Google Cloud JSON Key: click Load from JSON Key File and pick the file from Step 3, or paste its contents.
  2. Pinecone API Key and Pinecone Host URL: from Step 2.
  3. Anthropic API Key and/or OpenAI API Key: from Step 4. Then choose which one to use under Entity Extraction: Primary and, if you added both, Entity Extraction: Fallback.
  4. Post Types to Index: the content types the plugin may suggest as link targets (for example Posts).
  5. Click Save Changes. The plugin tests each key when you save and shows an error next to any key that does not work.

Step 6: Index your existing content

  1. Go to Internal Linking > Articles Indexing and click Start Indexing.
  2. Keep the page open until the progress bar reaches 100%. Indexing runs in small batches from this page, so closing it pauses the work. Click Start Indexing again later to continue.

After this first run, posts are indexed automatically when you publish or update them.

Step 7: Get link suggestions while you write

  • Block editor: open a post. In the right sidebar, on the Post tab, open Internal Links Suggestions and click Run Bulk Auto Suggestion. Matching phrases are highlighted in your text. Click Apply to insert a link, or Copy URL to add it yourself.
  • Classic Editor: select a phrase and use the Suggest Links button in the toolbar.

FAQ

What credentials do I need?

  • A Pinecone API key and index host URL (vector storage).
  • A Google Cloud service account JSON key with Vertex AI access (embeddings).
  • An Anthropic API key, an OpenAI API key or both (phrase extraction).

What does it cost?

The plugin is free. Each service bills you under your own account according to its pricing. Embeddings are created once per post and again when the post changes. The extraction provider is called only when an editor clicks Bulk Auto Suggestion. Check each provider’s current pricing and free allowances before indexing a large archive.

What data leaves my site?

See the External services section above. In short: post titles, short text extracts and metadata go to Google Vertex AI and Pinecone; the reduced post text goes to the extraction provider you choose, and also to the fallback provider when the primary fails. API keys are stored encrypted in your database. Review each provider’s data policies before indexing sensitive content.

How is this different from tag-based related posts?

Tag-based related posts need shared tags or categories. This plugin compares meaning, so a post about “sourdough starter” can match one about “fermenting bread dough” with no tags in common.

Does it slow down my site?

Indexing runs in WP-Cron and in the admin. Suggestions run only in the editor. Visitors are affected only if your theme calls ilsej_get_related_posts() or ilsej_get_embeddings() on the front end; related posts are cached per post. Logged-out calls to ilsej_get_embeddings() share an hourly budget (600 by default, filter ilsej_public_search_hourly_budget) so a flood of searches cannot run up your bill.

Does it work with the block editor?

Yes. It works in the block editor (Gutenberg) and in the Classic Editor (TinyMCE).

What happens when I publish a post?

A WP-Cron event creates the post’s embedding and stores it in Pinecone shortly after publishing. The new post then appears in suggestions and related posts.

Can I index custom post types or single pages?

Yes. Choose the post types to index in Settings (posts and pages by default). To index a few key pages without indexing every page, list their IDs in the extra page IDs field.

Can I tune which anchors are accepted?

Yes. The filters ilsej_generic_anchor_blocklist, ilsej_anchor_stop_words and ilsej_anchor_named_tokens adjust the anchor checks.

Will my data be deleted if I uninstall the plugin?

Only if you turn on “Delete data on uninstall” in Settings (off by default); that removes the plugin’s settings, transients and cron jobs. While the plugin is active, it deletes a post’s vector from Pinecone when the post is unpublished, deleted or leaves an indexed post type. Uninstalling never deletes your Pinecone index or the vectors still in it; remove those from the Pinecone console.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“AI Semantic Internal Links by WebGeeksMedia” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.2.0

  • Escape URLs, anchor text, and performance stats in editor JavaScript UI and validate URL schemes before inserting links.
  • Add rel="noopener noreferrer" to external links in editor insertion and admin settings descriptions.
  • Harden AES-256-CBC decryption with strict base64 decoding and IV length checks, and deduplicate admin notices.
  • Normalize scheme-less Pinecone host URLs across all query, upsert, and delete requests, redact secrets from error logs/transients, add explicit capability checks to admin render callbacks, and preserve raw GCP JSON credentials on save.
  • Display name is now “AI Semantic Internal Links by WebGeeksMedia” (brand moved to the end). The slug, folder and text domain webgeeksmedia-ai-semantic-internal-links are unchanged, so updates and settings carry over.
  • Centralize PHP error logging via ILSEJ_Core::log(): failures always reach the log, routine progress messages only with WP_DEBUG; remove commented-out debug code and stale phpcs:ignore suppressions, and update phpcs.xml to target PHP 8.2+ and WordPress 6.0+.
  • Add docblocks to plugin constants and improve inline PHP comments for readability; correct the Retry Logic setting description from 5 attempts to 3 attempts.
  • Fix all ESLint no-unused-vars warnings across editor JavaScript files.
  • Wrap remaining PHP admin notices, settings field descriptions, indexing missing-credential labels, filter “All” labels, and API validation errors in WordPress i18n translation functions under the webgeeksmedia-ai-semantic-internal-links text domain.
  • Localize all user-facing JavaScript strings across admin, Classic Editor, TinyMCE, and Gutenberg scripts via wp.i18n (wp_set_script_translations) and localized i18n dictionaries.
  • Update Gutenberg editor integration for WordPress 7.1.5 compatibility: use wp.editor.PluginDocumentSettingPanel (with wp.editPost fallback), variant/size props on Button, __next40pxDefaultSize/__nextHasNoMarginBottom props on form controls, and drop unused wp.element.render.
  • Guard transport exception objects returned by WpOrg\Requests\Requests::request_multiple() in parallel Pinecone queries.
  • Support the WordPress 7.0+ AI Client (wp_ai_client_prompt()) as an optional entity-extraction provider alongside direct Claude and OpenAI integrations.

1.1.1

  • The “Delete data on uninstall” warning toggle now lives in the enqueued
    admin script instead of an inline script tag.
  • Admin notices about key decryption and OpenSSL show to administrators only.
  • The readme states when vectors are deleted from Pinecone and lists the key
    checks made when credentials are saved.
  • The key decryption notice linked to the wrong settings URL.
  • The one-time routine that edited the active plugins list to clear an old
    plugin folder name.

1.1.0

  • Renamed to WebGeeksMedia – AI Semantic Internal Links for the WordPress.org
    directory. The plugin slug, folder, main file and text domain are now
    webgeeksmedia-ai-semantic-internal-links. Settings carry over because the
    option names are unchanged; a site running 1.0.0 should deactivate and
    delete the old folder after installing 1.1.0.

1.0.0

  • First public release.
  • Semantic link suggestions in the block editor and the Classic Editor, from
    Google Vertex AI text-embedding-005 embeddings stored in a Pinecone index.
  • Claude or OpenAI phrase extraction, with a primary and an optional fallback
    provider, structured output for Claude, and one shared time budget for all
    attempts.
  • Anchor checks: a named anchor must appear in the target’s title or slug, a
    one-word lowercase anchor must appear in the target, and generic one-word
    anchors need supporting context. The filters ilsej_generic_anchor_blocklist,
    ilsej_anchor_stop_words and ilsej_anchor_named_tokens adjust them.
  • ilsej_get_related_posts() for semantic related posts, with results cached
    per post.
  • Bulk indexing with token-budgeted Vertex AI requests, background sync on
    publish, update and delete, and an optional list of extra page IDs.
  • Category, tag, post type and age filters, plus site-wide excluded
    categories and tags.
  • AES-256-CBC encryption for stored API keys, rate limiting with retries, and an
    hourly budget for logged-out embedding calls
    (ilsej_public_search_hourly_budget).
  • An opt-in “Delete data on uninstall” setting.
  • Based on the original plugin by Vahan Petrosyan, published by Search Engine
    Journal under GPL-2.0-or-later.