gillish

Link keywords automatically with Auto-Link

Auto-Link finds chosen keywords in your posts and turns them into managed links when the page is shown. Your saved posts are not changed.

  1. Open a managed link and open Auto-Link keywords.

  2. Click Add keyword, or Add the link name to use the link’s name as a keyword.

  3. Under Which one to link, choose which mention of each keyword becomes the link.

  4. Save the link.

The Auto-Link keywords section of a managed link, with the Auto-Link for this link switch, a keyword field, Which one to link set to The first, and the Add keyword and Add the link name buttons.
The Auto-Link keywords section of a managed link.

To keep a link out of Auto-Link without losing its keywords, turn off the Auto-Link for this link switch at the top of the section. You can still insert the link by hand.

Make capital letters count

  1. Open the link and open Auto-Link keywords.

  2. Type each keyword with the capital letters it must have, for example Apple.

  3. Switch on Capital letters must match, below the keywords.

  4. Click Update link.

By default, capital letters do not matter: the keyword apple links “apple”, “Apple” and “APPLE”. With the switch on, the keyword Apple links “Apple” but not “apple” or “APPLE”, so the brand and the fruit stay apart. The switch counts for every keyword of that link. Phrases with {gap:n} keep their capitals too. Both engines follow it. To go back, switch it off and update the link. The keyword list shows each keyword with the capital letters you typed.

A keyword can appear many times in one post. Which one to link says which of them becomes the link:

  • The first: link only the first mention. Best for most keywords.
  • The last: link only the last mention, for a “learn more” near the end.
  • A random one: link one mention, picked at random. The pick stays the same until the text or the keyword changes, and the Sandbox Preview picks the same mention for the same text.
  • Every one: link every mention, as far as the limits allow. With the standard limits that is one mention per post, because Max auto-links to the same destination per post is 1: raise it, or set it to 0 for no limit, to link more. Use it with care.
  • None (keyword is off): reserve the keyword for this link without linking it.

Match phrases with gaps

Add {gap:n} to allow one to n words between two words (n can be up to 20). best {gap:3} camera matches “best cheap compact camera” and “best underwater camera”, but not “best camera”: at least one word must stand in the gap. A word in the gap may carry punctuation, as in “best cheap, compact camera”. The gap must sit between two words; a keyword that starts or ends with a gap never matches.

Under Settings → Auto-Link you set limits for each post: Max auto-links per post, Max auto-links to the same destination per post, and Intro guard (words), which keeps further auto-links out of the first words of a post. Two more limits, Max auto-links per paragraph and Proximity cap (words) (the fewest words between two auto-links), appear only after you switch on Use DOM walker engine (beta).

One post can have its own limit. Open the post, find the Auto-Link box at the side, and type a number from 1 to 999 in Most automatic links in this post. Then update the post. The box shows the site’s own limit under the field. To go back to the site’s limit, empty the field and update the post. Both engines use the post’s own number.

Auto-Link never puts a link on the page it leads to. Say a link sends visitors to your camera guide. The keyword is then linked in other posts, but not in the camera guide itself. A closing slash, www., http or https, and capital letters in the address make no difference. There is nothing to set.

Keep part of a post free of auto-links

Under Settings → Auto-Link, Skip CSS classes keeps one part of a post free of auto-links and leaves the rest as it is. Type one or more class names, split by commas, for example no-autolink, price-box. Then give a block A piece of a page, such as a paragraph, a picture or a button. In WordPress you build a page by putting blocks one after another. that class: in the block editor, open the block’s Advanced panel and type it in Additional CSS class(es). Nothing inside that block gets an automatic link. The class no-autolink always counts, even if you take it out of the list. Both engines read this setting. To undo, remove the class from the block or the name from the list.

No auto-link is ever put inside a button, such as a word with a pop-up explanation. A link there would take the click, and the pop-up would not open.

Leave whole groups of posts alone

  1. Go to Settings → Auto-Link.

  2. Find the card Posts left alone.

  3. Pick what to leave out. You can use one rule or several; they are listed below.

  4. Click Save changes at the bottom of the page. The posts change the next time someone opens them.

A rule keeps a whole group of posts free of automatic links, so you do not have to switch off Auto-Link in each post. Links you put in by hand stay as they are. The rules:

  • Leave out posts in these categories and tags: tick each category or tag. A post in any one of them gets no automatic links.
  • Leave out posts by these authors: tick each author, for example a guest writer.
  • Leave out posts published before: pick a day, for example to keep your old posts as they were. A post published on that day itself is still linked.
  • Leave out posts published after: pick a day. A post published on that day itself is still linked.

To undo a rule, untick the box or empty the day, and save. A post that is left out still shows in the Auto-Link column of the posts list as Active: that column only shows the switch on the post itself.

Keywords in more than one language

On a site that uses WPML, a plugin that translates your pages, a link’s keywords become links only in posts in the link’s language. The English keyword “tent” then stays out of your German posts.

  1. Open the link in Manage Links, and open Auto-Link keywords.
  2. Under Language of the keywords, pick the language the keywords are written in. Your site’s main language is marked “(main language)”.
  3. For a word that is the same in every language, such as a brand name, pick All languages. Its keywords then link in every post.
  4. Save the link.

A link that was there before this choice came belongs to your site’s main language until you change it. The choice shows only on a site in more than one language; on other sites nothing changes. Tested with WPML 5.3.0.

Why a keyword was removed

When you save a link, Node checks each keyword. A keyword is removed if it is too short (under 5 characters, unless it is the link’s own name) or if it is on the list of vague link words such as “click here” and “read more”. A yellow box at the top of the page then says why, one line per keyword. If another link already has the keyword, a red box named Keywords another link already has lets you choose Move it to this link or Leave it there.

Test before it goes live

On the Auto-Link page, the Sandbox Preview tab lets you paste any post content, click Run Preview, and see exactly what the engine would change in that text, without saving anything. Under Why each keyword was linked or not, each keyword gets one line for each time it appears, in plain words, for example “Mention 2 of 3 is linked.” A mention that was not linked names the setting that stopped it, such as Max auto-links to the same destination per post.

Some links are left out of Auto-Link on purpose. For each keyword whose link is left out, the preview shows one of these lines:

  • “Not linked: the page this link sends visitors to is gone (two checks in a row). Fix the link’s target, or turn off “Skip broken destinations” in Settings.”
  • “Not linked: this link has not started yet. It is linked from its start date.”
  • “Not linked: this link has ended (its end date has passed, or it reached its click limit).”

The preview uses the result of the last health check. It does not check the page again while you wait. To check now, open the Link Health dashboard, click 🔄 Run health check now, then run the preview again.

Skip broken destinations, under Settings → Auto-Link, is on when you install Node. While it is on, words in your posts are not turned into a link whose target page is gone. A page counts as gone only when it answers “not found” (404) or “gone” (410), or its domain no longer exists, two checks in a row. A site that refuses the check or answers too slowly does not count. When the page is back and the next check sees it, the link is used again. Turn the setting off to keep linking such links anyway. The Health column on the Auto-Link page shows which links are broken.

Next, read Redirect old addresses on your site.