Documentation

JnK Linkweave

JnK Linkweave suggests and inserts internal links between your posts, entirely on your own server. This page covers how it decides what to link and the hooks you can use to shape that behaviour.

How suggestions are computed

JnK Linkweave builds an index of your content and scores candidate links using TF-IDF (term frequency–inverse document frequency) with cosine similarity — a well-understood information-retrieval technique that runs locally, with no external API call. Posts whose vocabulary overlaps meaningfully with the current post surface as suggestions, ranked by relevance.

An optional BYOK (“bring your own key”) LLM mode can refine suggestions using your own OpenAI or Anthropic key. It’s off by default; with no key configured, all suggestions come from the local TF-IDF engine and nothing leaves your server.

Indexing

The index is built in the background and refreshed as content changes. Suggestions are cached as transients keyed on the post id and its modified time, so repeat page loads don’t recompute. You control which post types are indexed and which are eligible link targets from the settings screen — or in code via the filters below.

Auto-linking rules

Beyond suggestions, you can define rules that automatically turn a phrase into a link at render time. Rules apply late on the_content (after block and page-builder output) and never touch text that’s already inside an anchor, heading, code block, or shortcode — those regions are swapped out as placeholders before substitution and restored afterward, so existing markup is preserved.

Public filters

These filters let you adjust behaviour without editing the plugin (names as documented in the plugin’s readme.txt):

automatic_linker_suggestion_post_types  // which post types are indexed
automatic_linker_allowed_post_types      // which post types are eligible targets
automatic_linker_suggestion_score        // adjust a candidate link's score
automatic_linker_rerank                  // reorder the final suggestion list
automatic_linker_max_active_rules        // cap on simultaneously active rules
automatic_linker_is_pro                  // gate Pro-only behaviour

Public actions

automatic_linker_rule_applied       // fires when an auto-link rule rewrites content
automatic_linker_suggestion_inserted // fires when a suggested link is inserted
automatic_linker_broken_link_found   // fires when the scanner finds a broken link

Example: limit indexing to posts and a custom type

add_filter( 'automatic_linker_suggestion_post_types', function ( array $types ) {
    return [ 'post', 'guide' ];
} );

Reports

JnK Linkweave also scans for orphan content (posts nothing links to) and broken links, surfacing both as reports. The broken-link scan fires automatic_linker_broken_link_found as it goes, so you can log or notify on findings.