Skip to content

Auto-linking keywords ​

Turn keywords into links when a post is shown, choose which link wins a shared keyword, and limit where keywords link.

Auto-linking turns keywords you choose into links in your WordPress posts, each time a post is shown. You give a short link or an affiliate its keywords, and posts that mention them link to that short link, within the limits you set. Your saved posts never change, so turning auto-linking off takes the auto-links away the next time each post is shown.

Insert affiliate links automatically from keywords ​

When someone opens a post, Link Manager Pro finds your keywords in the post's text and turns them into links to the short link that owns them. Nothing is written into the post, because the links are added when the post is shown, not when it's saved. Give an affiliate keywords and you have auto affiliate links.

A sentence in a WordPress post with two auto-linked keywords, marked: 1 the keyword discount, 2 the keyword deal, both linked to the same affiliate's short link
In the saved post this sentence is plain text. Both words are an affiliate's keywords, so they become links when the post is shown.

In the post above, the saved text reads "Looking for a discount? This deal is the best we found." Both discount 1 and deal 2 are keywords of one affiliate, so visitors see them as links.

  • Each auto-link goes to the short link, like yoursite.com/link/spring-deal. The click counts for that short link, along with the post or page it came from, and the visitor goes on to the destination.
  • If you set an Affiliate link prefix, auto-links to an affiliate's domain use it, like yoursite.com/recommends/spring-deal (General settings).
  • An affiliate's keywords go to the affiliate's own short link: the one Link Manager Pro makes (or reuses) for its Affiliate URL when you save the affiliate.
  • The editor shows your text without the links. View the post to see them. Visitors and search engines get the same links on the post's own page. Your RSS feed, archive pages, the blog page and post excerpts don't get any.
  • Turning auto-linking off removes the auto-links from the next view, with nothing to clean up in your posts. A page cache can serve older copies for a while (Clear page cache when links change), and search engines keep the copy they already fetched.

Before you start ​

  • You need access to Link Manager Pro. Administrators always have it; editors only when you allow it (Access for editors).
  • Link keywords in posts automatically must be on under Link Manager › Settings › Auto-linking. It's on by default.
  • Keywords become links only in the Post types chosen on that tab: Posts and Pages by default.

A short link's keywords live in the Auto-linking section of its form.

Link Manager › Short Links
  1. Select Edit (the pencil) in the link's row. For a new link, select New short link at the top right.
  2. Turn on the switch of the Auto-linking section to open it. That switch only shows or hides the fields; it doesn't turn auto-linking on or off.
  3. Turn on Replace keywords automatically.
  4. Enter Keywords, separated by commas, like trail shoes, trail running shoes.
  5. Leave Priority on 10, or enter a lower number to win a keyword another short link also uses (Auto-link priority).
  6. Leave Auto-link only on empty to link on every post and page, or pick categories or tags (Limit keywords to some categories or tags).
  7. Select Save changes (or Create short link for a new link).

To check it worked, open a published post that contains one of the keywords. With the default settings, its first mention outside a heading is now a link, and hovering over it shows your short link's address. In the Short Links list, the link's Auto-linking column shows On and its number of keywords.

A short link takes up to 50 keywords, each up to 120 characters. A longer keyword shows Use 120 characters or fewer. More than 50 keywords show Use 50 keywords or fewer. (What the form's error messages mean). The rest of the form is on Create and edit a short link.

Add keywords to an affiliate ​

An affiliate's keywords link to the affiliate's own short link, and they beat every short link's keywords.

Link Manager › Affiliates
  1. Open the affiliate's report and select the pencil at the top right. For a new partner, select New affiliate.
  2. Open Auto-linking and turn on Replace keywords automatically.
  3. Enter Keywords, pressing Enter or a comma after each one. Each keyword takes up to 100 characters.
  4. Set Priority and Auto-link only on if you need them.
  5. Select Save changes (or Create affiliate).

If you delete the affiliate's own short link, its keywords stop linking (a short link with the same keyword, if there is one, takes them) until you save a change to the affiliate, which makes a new one. Affiliates covers the rest of the affiliate form.

Each keyword links to only one link on your whole site. An affiliate always beats a short link. Between two affiliates, or two short links, the lower Priority wins. With the same Priority, the one added to your site first wins.

  1. Affiliates come first, whatever their Priority numbers.
  2. Then the lower Priority: 0 is the highest, 100 the lowest. New short links and affiliates start at 10.
  3. Then the link or affiliate added first.

Say your affiliate has the keyword hiking boots with Priority 10, and your review's short link has it with Priority 1. The affiliate still wins, so posts link hiking boots to the affiliate. To give it to the review, remove the keyword from the affiliate.

Two different keywords can also overlap in a sentence, like trail and trail running shoes. Then the one that starts first in the text wins. Where both start at the same word, the longer keyword wins. Priority plays no part here.

With Match case off, keywords that differ only in letter case, like Apple and apple, count as one keyword, and the first in the order wins. With Match case on, they stay separate keywords. Auto-linking uses up to 200 keywords on your site, picked in the order above; keywords past that number aren't linked. The exact rules are in How keyword priority works.

Limit keywords to some categories or tags ​

Auto-link only on limits the keywords of a short link or affiliate to posts in the categories or tags you pick. Left empty, the keywords link on every post and page.

  • The list holds your WordPress post categories and tags, not the categories and tags you give short links (Categories and tags).
  • A post qualifies when it has at least one of the categories or tags you picked.
  • WordPress pages have no categories or tags by default, so a limited link doesn't link on pages.
  • Auto-link only on is checked for each post. If the first link for a keyword is limited and a post is outside its categories and tags, the next link in line that fits the post takes the keyword.

How often and where keywords are linked ​

The limits and matching rules sit on the Auto-linking settings tab and apply to every keyword on your site. With the defaults, each keyword is linked once per post, at its first mention.

SettingDefaultIn short
Link keywords in posts automaticallyOnOff pauses all auto-linking on the site; links keep their keywords
Max links per keyword1How often one keyword is linked in a post, counted from the top (1 to 50)
Max links per page0 (no limit)The most auto-links one post gets
Max links per destination URL0 (no limit)How many auto-links in one post can go to the same destination
Match caseOffOn: a keyword matches only in the letter case you saved
Skip headingsOnKeeps auto-links out of H1 to H6 headings
Post typesPosts and PagesWhere keywords become links

Whatever the settings, keywords match only as whole words: shoe doesn't match "shoes". The link keeps the text as it's written in your post.

Some text never gets auto-links: text that's already a link, code, form fields, and HTML attributes such as image alt text. A keyword is also skipped on the post its Destination URL points to, so a post doesn't link to itself. The full list is in Skip headings and text that is never linked.

Auto-links get a rel attribute, like nofollow or sponsored, from two places. Your rel settings under Link Manager › Settings › Redirection set the base, and a short link's own Link attributes are added on top.

  • For an affiliate's keywords, the affiliate's own Link attributes replace the site settings when any box is ticked.
  • A link to your own site never gets nofollow or sponsored.
  • The rel is worked out each time a post is shown, so a change shows on the next view. With a page cache, clear it after saving the Redirection tab: that save doesn't clear it for you.

Where the rel settings apply compares auto-links with masked links and replaced shortcodes.

Details ​

Auto-linking runs on the post content only, after blocks and shortcodes, and never in the editor. The exact behavior:

TopicBehavior
When it runsOn WordPress's the_content filter at priority 99, after blocks and shortcodes are turned into HTML. So text a block or shortcode outputs can get links too
Where it doesn't runAdmin screens, AJAX requests (like a theme's load more button), cron, REST API requests, feeds, archive pages, the blog page, excerpts, and other posts shown inside a page (a Query Loop or related posts). It links only the content of the post or page being viewed. Titles, comments and widgets aren't part of the post content
Order in a postFrom the top down: the first matches get the links until a limit is reached
Link addressyoursite.com/<prefix>/<slug>, with the post's ID added on posts and pages so the click is credited to that post. The prefix is the Affiliate link prefix for a destination on an affiliate's domain, the Internal link prefix for your own site while Mask internal links is on, and the Short link prefix otherwise
Keyword listKept ready between page views. Rebuilt when you create, edit or delete a short link or an affiliate, save the Auto-linking tab, change a prefix or Mask internal links, import from another plugin or restore a backup
Page cacheThose changes also clear the page cache of supported cache plugins while Clear page cache when links change is on, at most once every 30 seconds, and a change made inside that window triggers one more clear when it ends (Integrations settings)
Scheduled or expired linksTheir keywords aren't linked while the short link is scheduled or expired. They link again once it is live. A cached copy of a post can still show an older auto-link
ImportsKeywords imported from ThirstyAffiliates or BetterLinks can switch auto-linking on for those links. They start linking once the plugin they came from is switched off (Migrate to Link Manager Pro)
WP-CLIunlink --disable-autolink turns off Link keywords in posts automatically after a real run that found posts (WP-CLI commands)

Get more out of it ​

  • Check a keyword's reach before it goes live. Save the keywords on an affiliate with Replace keywords automatically off, as Affiliates describes, and read Found in on the report's Keywords tab. It counts published posts of your Post types whose text contains the keyword as a whole word, headings included, for the first 50 keywords, refreshed about hourly. So it's an upper bound, not the posts that get a link.
  • Prefer phrases to single words. A phrase like hiking boots links where you mean it; a word like boots links in every post that says it. Add the forms people write, like trail shoe, trail shoes, because only whole words match. Each form can then link once in the same post: set Max links per destination URL to 1 and each post links to that short link at most once (Auto-linking settings).
  • Pause one link's keywords without losing them. Turn off Replace keywords automatically on that link and select Save changes. The keywords stay saved, and turning it back on brings their links back.
  • Find out who owns a keyword. Search for it in the Short Links list and with Search affiliates… on the Affiliates screen; both search keywords. Or hover over the auto-link in your post: the slug in its address is the short link that won.

If something goes wrong ​

  • If a keyword doesn't become a link, then check Replace keywords automatically on the link or affiliate and Link keywords in posts automatically in the settings. Then check the post type, whole-word matching and the letter case with Match case on. A heading, an existing link, a limit or another link that wins the keyword can also keep it off.
  • If a keyword links to the wrong place, then another short link or an affiliate has the same keyword and wins it. Search for the keyword in the Short Links list and on the Affiliates screen, then remove it from the link that shouldn't have it, or change a Priority.
  • If a link with Auto-link only on doesn't link on some posts, then check that those posts have one of its categories or tags. Pages don't, unless a plugin gives them categories or tags.
  • If an auto-link opens your 404 page, then a cached copy of the post may hold an auto-link from before the short link expired. Clear your page cache.
  • If auto-links still show after you turn them off, then a page cache is serving an older copy. Clear your cache (Integrations settings).

More fixes are on Troubleshooting.