How to Automatically Link Affiliate Keywords in WordPress

If you run an affiliate site, your links are the product. And the awkward truth about affiliate blogs is that most of the money is sitting in posts you wrote two years ago — the ones mentioning a product by name, twenty times over, with not a single monetised link in sight.
You publish a review today. But you’ve mentioned that product across forty older articles since 2023. Going back through all forty by hand is the job nobody does, which is why it stays undone. Automatic keyword linking is how you do it in one step instead.
Why automate affiliate links at all
- It monetises your archive. Older posts often carry the steady long-tail traffic. Every unlinked brand mention in them is a click you’re not being paid for.
- It makes network changes survivable. When a programme moves from one network to another — and they do — you change one rule instead of editing every post that ever mentioned the brand.
- It keeps new posts consistent. Write naturally, mention the product, and the link appears without you remembering to add it.
Setting up keyword rules
Disclosure up front: JnK Linkweave is our plugin. It’s free on the WordPress.org plugin directory, and keyword rules are in the free version, so you can test this properly before deciding anything.
Step 1 — Create the rule
Go to JnK Linkweave → Rules and add one:
- Keyword: the phrase as you actually write it —
Bluehost - Target URL: your affiliate or cloaked redirect URL
You can also restrict a rule to specific post types, make it case-sensitive, and set it to open in a new tab. Start with one rule for your best-earning programme rather than importing thirty at once — you want to see what the output looks like on a real page first.
Step 2 — Cap it before it looks like spam
The single setting that matters most here is max links per post. If a review mentions “Bluehost” fifteen times, you do not want fifteen identical affiliate links — that reads as spam to visitors and to Google. Set it to 1 or 2 and only the first occurrences get linked.
You don’t need to protect your headings or your existing links: Linkweave automatically skips headings (h1–h6), text that’s already inside a link, code and preformatted blocks, and shortcodes. That’s built into how the replacement works rather than being a setting you configure, so there’s nothing to switch on and no way to accidentally have a keyword eat your layout.
Step 3 — Disclose properly
Google requires affiliate links to be marked as paid, and unmarked affiliate links are a genuine ranking risk rather than a theoretical one. Tick nofollow on every affiliate rule you create — that’s the qualifier Linkweave emits, and Google accepts it for paid and affiliate links.
Worth being precise, because this trips people up: rel="sponsored" is Google’s more specific value for paid links, and Linkweave doesn’t emit it today — rules produce rel="nofollow". Google’s documentation is explicit that nofollow remains acceptable for this purpose, so a nofollowed affiliate rule is compliant. If your own policy requires the sponsored value specifically, add those particular links by hand. And none of this replaces a visible affiliate disclosure on the page — that’s an FTC requirement, not an SEO one.
How the links are applied
Worth understanding, because it changes how you think about risk: rules are applied when the page renders, not by rewriting your posts. Your post content in the database is never modified. Delete a rule and the links disappear everywhere immediately; deactivate the plugin and your content is exactly as you wrote it.
That’s the big advantage over search-and-replace approaches, which permanently bake links into your posts and leave you with a mess if a programme ends. The trade-off is that render-time links don’t show up in link-graph reports, including Linkweave’s own Orphans screen — which is only relevant if you’re also using it to audit site structure. See finding and fixing orphaned pages for that side of things.
Rules to keep it from backfiring
- Don’t link generic words. A rule on “hosting” or “coffee” will fire on every page and look automated, because it is. Rules work on brand and product names.
- Watch your anchor diversity. Hundreds of identical exact-match anchors pointing at one URL is a recognisable pattern. Vary the keyword phrases you target.
- Review after the first week. Open five older posts and read the linked sentences as a visitor would. If a link doesn’t help the reader, tighten the rule.
For internal (non-affiliate) linking the same engine applies, but the strategy is different — that’s covered in automatic internal linking in WordPress, and if you’re weighing tools, in the best Link Whisper alternative.
Frequently asked questions
Does automatic affiliate linking hurt SEO?
Not when the links are qualified and used sparingly. The risks are unmarked paid links, which violate Google’s guidelines, and over-linking the same anchor text hundreds of times, which looks manipulative. Setting a low max-links-per-post and ticking nofollow on every affiliate rule addresses both.
Should affiliate links be nofollow or sponsored?
Google introduced rel="sponsored" as the more specific value for paid and affiliate links, but has stated that rel="nofollow" continues to be accepted for the same purpose. Either qualifier keeps you compliant; what matters is that affiliate links are not left unqualified.
Will automatic links change my existing posts?
With JnK Linkweave, no. Keyword rules are applied as the page is rendered, so your stored post content is untouched. Removing a rule removes the links from every page at once, and deactivating the plugin leaves your posts exactly as originally written.
The bottom line
The traffic on your old posts is already paid for. One keyword rule per affiliate programme, a cap of one or two links per post, and nofollow ticked turns that archive into something that earns — without touching a single stored post. Install JnK Linkweave free from WordPress.org and start with your best-earning programme.