Automatic Internal Linking Rules for Any Website

This page is for any website: WordPress or custom-built, a store or a content site!

The rules here don’t depend on any platform. Any automatic internal linking tool, on any site, has to follow them.

Is your site on WordPress? I built a free plugin that runs these exact rules, and I explain how to install and set it up, step by step, on the WordPress internal linking plugin page. Is your site custom-built, or does it run on a CMS (a content management system such as Joomla or Shopify)? Send the section on custom code and CMS platforms to your technical team.

Internal linking means linking from one page of your site to another page on the same site. Automatic internal linking means you decide once which keywords should link to which page. From then on, wherever those keywords appear in your site’s text, the link is created automatically. No more going through articles one by one and adding links by hand!

Some people call this auto linking or automatic keyword linking, and call the software an internal linking tool. All of these names describe the same job! On this page, I explain the rules such a tool needs, on any site, so it doesn’t make a mess of your links.

Does automatic internal linking actually work?

If the tool follows the right rules, yes! Automation on its own doesn’t break anything. Wrong rules do. Each rule is a specific behavior the tool must follow, for example never creating a link in the middle of a word.

Most people who are wary of automatic links worry about three things:

  • The tool adds a link in the middle of a word.
  • The tool links to the same page ten times in a row.
  • The tool breaks links you added by hand.

Each of these has its own rule, and I explain them in full further down under the codes M1, C1 and L1. With a tool that gets these rules right, the chance of these mistakes drops sharply. If a tool doesn’t have them, you’re right to be worried!

I (Mohsen Tavoosi) worked out these rules myself, after 15 years in SEO and a background in software development. Under each rule you’ll find the reason, with one wrong example and one right example.

One more note, so the two don’t get mixed up. This page is about links between the pages of your own site. Getting links from other sites, known as link building, is a separate topic.

What do keyword group, intent and link limit mean?

Learn these three terms before the rules, and everything after this gets easier!

  • Keyword group. All the keywords and phrases that should link to one page, together with that page’s URL. For example, for a security cameras page, you create a keyword group with “security cameras”, “buy security cameras” and “CCTV cameras”. Every keyword in a keyword group links only to that one page.
  • Intent. What the searcher actually wants. Someone who searches “garage doors” wants any kind of garage door, but someone who searches “insulated garage doors” wants only insulated ones!
  • Link limit. The maximum number of links created from the keywords of one keyword group, on one page or in one paragraph.

In a sample shoe store, “men’s running shoes” and “women’s running shoes” have different intents, so each one gets its own keyword group and its own page. “best running shoes” links to an article, not to a product page. You can see this store’s keyword groups in the image below:

Infographic of a shoe store where each keyword group, holding the keywords of one intent, links to its own page

Pay attention here! Keyword targeting decides which keywords go into a keyword group, not the tool. Targeting means deciding which page each keyword should target. Synonyms, and phrases that only add “buy” or “price” (like “buy running shoes”), go together in one keyword group because they share the same intent. But someone searching for men’s, women’s, lightweight or orthopedic running shoes wants something different each time, which is why each of these has its own page. If you put all of them in one keyword group, every phrase links to the running shoes page, and the men’s, women’s and orthopedic pages never get a link!

What are the rules of automatic internal linking?

There are 24 rules in five groups. I go through each group separately, and every rule has a code (like S1) so it’s easy to refer to. Don’t drop a rule without a solid reason! Each one prevents a specific mistake.

What are the safety and data rules?

Safety rules are the first thing any automatic internal linking tool needs. If something goes wrong, these rules decide whether you lose a few minutes or a few weeks of work.

S1. Links are created only when the page loads

Rule. Links are created only at the moment a page is served to a visitor. The page’s original text, the version stored in your site’s database, never changes. Why. If you switch the tool off, the links disappear from every page at once and the original text stays untouched. For most sites, the server load is low as well! If links were written into the original text instead, undoing them would mean keeping a before-and-after copy of every page. And restoring a full site backup wipes out every order, article and comment added after that backup!

Wrong. The tool writes links into the stored text of each article. Right. You open the article in the editor and there isn’t a single automatic link in it. The links exist only on the page the visitor sees.

The image below shows how this works:

Infographic showing that automatic internal links are created when the page loads and the stored text in the database is never changed

S2. Writing links into the stored text, only if the site admin chooses it

Rule. For a very large, high-traffic site, where creating links on every page load puts real pressure on the server, a second mode can save links into the original text. This mode has four conditions. First, link creation on page load (S1) always stays the default. Second, before anything is written, a full site backup and a before-and-after copy of every page are saved. Third, every change can be undone with one click. Fourth, manual links stay intact (rule L1, further down). Why. Some sites are so large and busy that building links on every page load doesn’t pay off for them. But even those sites need a way back!

Wrong. This mode is on from the start and keeps no copy of anything. Right. S1 is the default. This mode is turned on only when the site admin chooses it, and only after a full backup.

S3. One switch that turns off every link

Rule. There must be one switch that turns off every automatic link at once, without deactivating the whole tool. Why. If you notice something odd after launch, every link should be gone from every page within seconds. You shouldn’t have to hunt down keyword groups and delete them one by one!

Wrong. To stop the links, you have to delete every keyword group one by one. Right. There’s an “Enabled” checkbox. You untick it, and the links disappear from every page while your keyword groups stay where they are!

S4. Exporting and importing keyword groups (Export and Import)

Rule. You must be able to export every keyword group to a file and import that same file back. JSON is the best format for this. It’s a text file with a fixed structure that both people and software can read. An imported file also has to be checked in full before anything is deleted or replaced. Why. This file is the backup of your keyword groups. It’s also what you need to move the site, and AI can read your keyword groups from it or build new ones for you!

Wrong. The imported file is broken, and the tool first deletes every current keyword group and only then shows an error. Right. The tool checks the whole file first. If something is wrong, it doesn’t touch the current keyword groups.

S5. Security is enforced

Rule. Only the site admin can create keyword groups. Only URLs that start with http or https are accepted. Everything that’s entered is cleaned of harmful code, and forms are protected against request forgery (CSRF). Why. The URL field is exactly where someone could plant harmful code! Request forgery means someone submits a form on the admin’s behalf, without the admin knowing.

Wrong. A URL that starts with javascript is accepted as a link target. Right. URLs that start with javascript or data, and URLs without http or https, are rejected.

S6. All content areas of a page are processed together, never the menu or footer

Rule. All content areas of a page are processed together. That means the text written in the editor, sections built with a page builder such as Elementor, product descriptions and category descriptions. This way, the link limit and the keyword order count for the whole page. The menu, header, footer and sidebar are never processed. Why. If each area were processed on its own, a page with three areas could end up with three links to the same page! Processing all areas together doesn’t add server load. If your site uses a cache, meaning it keeps a ready-made copy of each page, this happens once, when a fresh copy is built.

Wrong. Each area of the page is processed separately, and the “1 link” limit counts once per area. A page with three areas gets three links to the same target. Right. The limit counts for the whole page, and the same three-area page gets only one link to that target.

What are the keyword group rules?

K1. Each keyword group holds every way people write the keyword

Rule. Each keyword group has a list of keywords and phrases (I suggest 20 at most) that all link to one URL. Every way of writing one intent goes into this list: with and without a space, singular and plural, with words like “buy” or “get”, synonyms and abbreviations (like “CCTV”). The link is created on whichever form appears in the text. Why. People write the same thing in several ways, and every one of those forms should link to the same page!

Wrong. For a security cameras page, only “security cameras” is added, and every other form stays unlinked. Right. The keyword group for the security cameras page includes “security cameras”, “buy security cameras”, “home security cameras”, “surveillance cameras” and “CCTV cameras”.

K2. Each keyword has only one target page

Rule. If you add a keyword to a second keyword group, the tool must reject it and show an error, whether the target page is an article, a product or a category. Why. In keyword targeting, each intent has only one page, and this rule applies the same principle to links. If one keyword linked to two pages, nobody could tell which page it really belongs to!

Wrong. “second mortgage” (a second loan on the same home) is also added to the keyword group of the “second home mortgage” page (a loan to buy a second home), even though their intents are different. Right. Each one goes only into its own page’s keyword group, and a second entry is rejected with an error.

K3. Each URL has only one keyword group

Rule. Each target URL appears in only one keyword group. Why. All the keywords that link to one page must be in one keyword group. Otherwise the link limit (C1) for that URL is counted more than once!

Wrong. Two separate keyword groups are created for one URL. Right. That URL has a single keyword group, with all its keywords inside it.

K4. The order is fixed and predictable

Rule. The order of keyword groups, and the order of keywords inside each keyword group, is saved, so the links come out identical every time. Why. When two keywords could both take a link, this order decides which one gets it first!

Wrong. The keyword order changes every time you save. Right. The order is exactly the one you entered.

Deciding which page each keyword belongs to is keyword targeting, and I teach it step by step in my SEO course. If you’d like this done with my ready-made skills inside your own AI, take a look at Mohsen Tavoosi’s MCP. It’s a monthly subscription that gives your AI my ready-made skills, which are instruction files that teach AI how I work.

What are the rules for matching keywords in the text?

M1. Only whole words get a link

Rule. A keyword gets a link only when there’s a space or a punctuation mark (such as a period or a comma) on both sides of it. If it’s attached to another letter or number, it doesn’t get a link. Why. A link in the middle of another word changes the meaning!

Wrong. “book” inside “notebook” gets a link. Right. “book” gets a link only when it stands on its own.

M2. Uppercase and lowercase don’t matter

Rule. SEO and seo count as the same word, and the link text keeps the exact form written on the page. Why. The site admin shouldn’t have to add every capitalization of a word!

Wrong. “SEO” is saved, and “seo” in the text stays unlinked. Right. The link is created, and its text stays “seo”.

M3. The longer phrase takes priority and its spot is reserved

Rule. When a short phrase appears inside a longer one, the longer phrase takes priority, and that spot in the text is reserved for it. This holds even if the longer phrase has reached its link limit and gets no link there. The short phrase gets a link only where it appears on its own, and only within its own link limit. If two phrases are the same length, the order of keyword groups, then the order of keywords inside the keyword group, decides which one gets the link (K4). Why. If the short phrase linked first, the long phrase that contains it would never get a link. And if the long phrase’s spot opened up once its limit was reached, the short phrase would link inside it, to the wrong page.

There are also two optional settings, both off by default. With the first one, once the long phrase reaches its link limit, its spot opens up, so the short phrase inside it can get a link within its own limit. With the second one, if the short phrase has no link anywhere on the page, it gets one link inside a long phrase, as long as that long phrase isn’t linked at that spot. A link inside another link is never created.

Wrong. In “Get Second Home Loan”, only “Second Home Loan” gets a link. Or the link limit of “garage door opener” has been reached, and in the second “garage door opener”, only “garage door” gets a link. Right. “garage door opener” gets a link as a whole, and the second one stays completely unlinked. “garage door” gets a link only where it appears on its own.

Since the longer phrase keeps its spot, “men’s running shoes” links as a whole to the men’s page, instead of “running shoes” inside it linking to the general page. You can see this in the image below:

Infographic showing that the longer phrase men's running shoes gets the link instead of the shorter phrase inside it

M4. Different kinds of spaces count as one

Rule. A normal space and a non-breaking space (a space where the browser never breaks a line) count as the same. The & sign also counts as the same, whether it’s typed directly or written as & in the HTML. Why. Page text isn’t always typed plainly, and editors sometimes change these characters!

Wrong. “R&D” (research and development) gets no link when it’s written as & in the page code. Right. “R&D” gets a link in both cases.

M5. Treating ZWNJ as a space is a setting

Rule. There should be a checkbox that treats the zero-width non-joiner (ZWNJ) as a normal space, both in keywords and in page text. ZWNJ is an invisible character that some languages, mostly those written in Arabic script, place between two parts of a word. This checkbox is on by default. But if a keyword is joined to a suffix with a ZWNJ, it doesn’t count as a whole word and gets no link (M1). Why. Writers in those languages use ZWNJ all the time, and the tool has to recognize it! If your site’s language gives ZWNJ its own meaning, turn the checkbox off. On an English site, it makes no difference either way.

Wrong. A keyword is saved with a normal space, the text has a ZWNJ in the same spot, and it gets no link. Right. With the checkbox on, it gets a link. With the checkbox off, it doesn’t, which is correct for languages where the two characters mean different things.

M6. Link diversity by keyword order (recommended, on by default)

Rule. In each keyword group, the first link goes to keyword number 1, if it appears on the page and a longer phrase hasn’t reserved its spot. The next link goes to the first keyword that hasn’t been linked on this page yet, and so on down the list. Once every keyword that appears on the page has been linked once, it starts again from number 1. A correct link that’s already on the page counts as that keyword’s link. All of this happens within the link limit. Why. Links spread across every form of one intent, and the site admin decides which form matters more through the order of the list, instead of whichever keyword comes first in the text taking the link!

Wrong. A keyword group has [1 “running shoes”, 2 “buy running shoes”] with a limit of 1, and the page text says “buy running shoes … why running shoes matter”. The link goes to “buy running shoes” because it comes first in the text, even though the site admin ranked number 1 higher. Right. The standalone “running shoes” gets the link, and the spot of “buy running shoes” stays reserved. If this checkbox is off, the list order doesn’t matter, and whichever keyword appears first in the text gets the link. This rule works correctly only when all areas of the page are processed together (S6).

What are the rules for link placement and existing links?

Z1. Only text the visitor reads gets links

Rule. Parts of the page code that visitors don’t see as text never get links, such as tag attributes, script and style code, code samples inside code and pre, form fields (textarea), buttons and svg images. Why. These parts aren’t text that a visitor reads, and putting links inside them breaks the page code!

Wrong. The word “SEO” inside a code sample in an article gets a link. Right. Only the normal text of the page gets links.

In the image below, only the content area gets links, and the menu, header, sidebar and footer never do:

Infographic of a web page where the menu, header, sidebar and footer get no links and only the main content does

Z2. A page never links to itself

Rule. A page doesn’t link to its own URL. If the URL of this page is written without the domain (a relative URL), or with its characters encoded (like %20), it still counts as this same page. Why. A link to the same page takes the reader nowhere!

Wrong. On the “athletic shoes” page, the text “athletic shoes” links to that same page. Right. That text stays unlinked.

Z3. You choose where links are created

Rule. You must be able to choose which page types (posts, products, categories and so on) and which areas (category descriptions, product descriptions and so on) get links. A keyword group can also be limited to a few specific pages for testing. The site’s homepage gets its own checkbox. Pages that must never get links are picked by searching their title, so nobody has to type a page ID. Why. The first time, you need to be able to test the tool on a single page!

Wrong. The tool runs on the whole site from the very first moment, with no way to test it. Right. You limit a keyword group to one page, and if the result is right, you remove the limit.

Z4. Every editor and page builder is covered

Rule. Text written with any editor or page builder, including their HTML blocks, gets links, and no text is processed twice. Why. Site content isn’t only in the main editor. If part of the page gets no links, or gets processed twice, the link limit breaks!

Wrong. Text built with a page builder gets no links at all, or it’s processed twice and gets two links. Right. Each area is processed exactly once.

L1. Links already on the page are handled correctly

Rule. There are four cases:

  • A link whose text is exactly the keyword and whose URL is correct stays as it is, and it counts toward the link limit.
  • A link whose text is longer than the keyword stays as it is, and no link is created inside it.
  • A link whose text is exactly the keyword, but whose URL is different from the keyword group’s URL, gets the correct URL.
  • Links without a URL, email links (mailto) and # links (links to a section of the same page) stay as they are.

Why. What counts as right or wrong is what the site admin defined in the keyword groups, not the tool’s guess!

Wrong. “security cameras” gets a link inside the manual link “network security cameras”, so one link ends up inside another. Right. The manual link stays intact, and nothing is linked inside it.

What are the link limit rules?

C1. Link limit per page for each keyword group

Rule. The default limit is 1 link per page for each keyword group. All the keywords of one keyword group count together. The count covers the whole page, even when the page is built from several areas. On pages that list several articles one after another (like a category page), the limit counts separately for each article. Why. Linking to the same page too many times clutters the text!

Wrong. “buy garage doors”, “garage doors” and “garage door styles” link to the same target three times on one page, because each form was counted separately. Right. All three forms count as one, and only one link is created.

A limit of 1 means one link on the whole page, even when the page is built from several areas. The image below shows the wrong and the right version of this:

Infographic comparing the wrong and the right way to apply a limit of one link on a page built from three areas

C2. Link limit per paragraph

Rule. The link limit per paragraph can be changed, and 0 means no limit. Why. Some sites don’t want more than one link to the same target in one paragraph, and some don’t mind. So the number shouldn’t be fixed!

Wrong. A fixed number is hard-coded into the tool. Right. The number can be changed.

C3. A paragraph can be defined in two ways

Rule. In the first way, every p or br tag counts as a paragraph. In the second, all the text between two headings counts as one paragraph, and so does the text before the first heading and after the last one. Why. The heading method doesn’t fall apart when you change the site theme, since some themes put every line in its own p tag!

Wrong. Only the p tag defines a paragraph, and changing the theme makes the paragraph limit meaningless. Right. Both methods exist, and the site admin picks one.

How does the tool decide where to add links, step by step?

Your tool must follow exactly these eight steps, and in this order:

  1. If the “Enabled” checkbox is off, or this page shouldn’t get links, the tool does nothing.
  2. The tool prepares the keywords so that uppercase and lowercase letters, spaces and ZWNJ make no difference (M2, M4 and M5), and sorts them from longest to shortest. When two keywords are the same length, they’re sorted by the order of keyword groups, then by the order of keywords inside the keyword group.
  3. The tool reads all content areas of the page together (S6). Places that must not get links (Z1) and existing links are set aside. Existing links are checked first and count toward the link limit (L1).
  4. The tool finds every place where a keyword appears in the text, longest phrases first. Each match that doesn’t overlap a spot that’s already reserved is reserved for that phrase, whether or not it ends up with a link.
  5. Matches whose target is this same page are dropped (Z2).
  6. From the reserved spots, links are chosen within the link limits (C1 and C2). If link diversity is on, they’re chosen in the keyword order of each keyword group. If it’s off, in the order they appear in the text.
  7. If either of the two optional M3 settings is on, the tool applies that setting.
  8. Links are created only on the page the visitor sees, and the original text doesn’t change, unless the site admin has turned on writing into the original text (S2).

The image below shows the same eight steps, in the same order:

Infographic of the eight steps an automatic internal linking tool follows to choose where links go

Because of this reservation, a short phrase doesn’t get a link inside a long phrase!

How can I be sure an internal linking tool works correctly?

With test cases. A test case is a specific example whose correct result is known in advance. Your tool must produce exactly the correct result for every example in the table below. If even one comes out wrong, don’t turn the tool on for your site!

# Keyword group Page text Correct result
1 “book” a new notebook No link
2 “book” this book is great “book” gets a link
3 “Second Home Loan” and “Get Second Home Loan” how to Get Second Home Loan All of “Get Second Home Loan” gets a link, not the part inside it
4 Only “Second Home Loan” how to Get Second Home Loan “Second Home Loan” gets a link
5 Keyword group A “garage door opener” and keyword group B “garage door” garage door opener The whole phrase links to page A
6 A keyword saved with a normal space (ZWNJ checkbox on) The same keyword written with a ZWNJ Gets a link
7 A keyword saved with a normal space (ZWNJ checkbox off) The same keyword written with a ZWNJ No link
8 “security cameras” The manual link “network security cameras” is already there The manual link stays intact, and no link is created inside it
9 “home loan” with URL X A “home loan” link to URL Y is already there The link URL changes to X
10 “SEO” The word inside a code sample or a tag attribute No link
11 “SEO” with this page’s own URL “SEO” in the text No link
12 “SEO” with a limit of 1 per page “SEO” three times across two page builder areas Only one link on the whole page
13 “R&D” R&D written as & in the HTML Gets a link
14 Adding “second mortgage” to two keyword groups None A duplicate keyword error
15 “SEO” seo tips A link with the text “seo”
16 Keyword group A “garage door opener” with a limit of 1, and keyword group B “garage door” garage door opener … garage door opener again Only the first one links to A, and the second stays completely unlinked
17 The same keyword groups as example 16 garage door opener … what is a garage door The first links to A, and the standalone “garage door” links to B
18 One keyword group [1 “running shoes”, 2 “running sneakers”, 3 “jogging shoes”] with a limit of 2 and link diversity on jogging shoes … running sneakers … running shoes … jogging shoes “running shoes” and “running sneakers” get links
19 Example 18 with link diversity off jogging shoes … running sneakers … running shoes … jogging shoes The first “jogging shoes” and “running sneakers” get links
20 One keyword group [1 “running shoes”, 2 “running sneakers”] with a limit of 1 and link diversity on Two page areas, “running sneakers” in the first and “running shoes” in the second “running shoes” in the second area gets the link
21 Example 16 with the first optional M3 setting on The same text as example 16 In the second one, “garage door” links to B

If you’re building the tool with AI or a technical team, ask them to write every one of these examples as an automated test, and to make sure every test passes before the tool goes live on your site!

On a real page, the link is created right inside the text, on the exact phrase. You can see an example in the image below:

A sample store article in which running shoe phrases link to the page of their own intent

How do I launch automatic internal linking safely?

The launch has seven steps, and you shouldn’t skip any of them! Each step prevents a costly mistake:

  1. Back up the whole site, and your current keyword groups if you have any (S4).
  2. Leave the default settings alone. They’re excellent and don’t need changes, unless the way your site works really calls for one.
  3. Build keyword groups from keyword targeting, not from guesses. Each page’s keyword group should hold every way of writing that page’s intent (K1), and no keyword should be in the keyword groups of two pages (K2). If you use AI to build keyword groups, the AI should only apply the targeting criteria, not make its own decisions. I teach these criteria in my SEO course.
  4. Limit a keyword group to one page (Z3) and look at that page with View Source. Check that the link position and the number of links are right, and that manual links and the page code are intact. View Source, not Inspect! Inspect shows what JavaScript changed after the page loaded.
  5. Remove the limit, then clear the site cache and the CDN cache. The cache is the ready-made copy of your pages, and a CDN is a network of servers that keeps that copy close to your visitors. If you don’t clear them, the old page without links keeps showing.
  6. If you see a problem, one checkbox turns off every link (S3). Restoring a backup is the last resort, since every order and article added after that backup would be lost!
  7. Track the results in Search Console, for example impressions (how many times the page appeared in Google results) and clicks. If you see a change, just know that it happened at the same time as the links, not necessarily because of them! It could come from a Google algorithm update, or from earlier work that’s only now showing results.

How do these rules work on custom code, CMS platforms and WordPress?

These rules don’t depend on any platform. Any site whose page HTML is built on the server, before it reaches the browser, can have them. If your site runs on WordPress, it’s the easiest case of all, and I explain it below! If you don’t have a technical team, you can give this page to AI and have it build these rules into your site. But give AI only the implementation! I (Mohsen Tavoosi) set these rules, and AI isn’t supposed to decide which rule stays and which one goes.

What about WordPress?

For WordPress, I built the free MT Smart Link Automation plugin, which runs these same rules, with no coding needed. I explain installation, settings and creating internal links in WordPress, step by step with screenshots, on the WordPress internal linking plugin page. The plugin is published in the official WordPress plugin directory (WordPress.org), so you can find it by searching its name under Plugins, Add New in your WordPress admin, as you can see below:

MT Smart Link Automation plugin card in the WordPress Add Plugins screen with the Install Now button

Here is the plugin’s page on WordPress.org: MT Smart Link Automation.

On custom code, what should the technical team build?

The programming language doesn’t matter, whether it’s PHP, Node.js or anything else! Three parts are needed:

  • Storage for keyword groups. Each keyword group has a target URL and an ordered list of keywords (up to 20). The link limit per page, the link limit per paragraph, the paragraph method and an optional list of pages the keyword group is limited to are also saved for each keyword group. Global settings are needed too: the switch that turns off every link, the ZWNJ checkbox, the link diversity checkbox, the two checkboxes for the optional M3 settings, the homepage checkbox and the list of pages that must never get links.
  • A simple admin panel. In this panel, you add keyword groups, with an error for a duplicate keyword or URL (K2 and K3). Export and Import (S4) and limiting a keyword group to a few pages for testing (Z3) are needed as well.
  • The part that creates the links. It runs the same eight steps described above.

Where on the site should the linking part run?

It has to run where the final HTML of the page is built, after all the content areas are put together and before the cache saves the final copy. This stage has a different name on each platform. On some it’s the template engine, on others it’s middleware or an output filter, and on a static site it’s the build step.

For your technical team:

  • Parse the HTML as a tree (the DOM) and process only the text nodes. A plain find and replace on the whole HTML won’t work, because it can’t tell where links must not go (Z1)!
  • Links have to be created on the server. A link the browser adds with JavaScript after the page loads isn’t in the page source!
  • If the site uses a cache, links are created only when a fresh cached copy is built (S6).

What about website builders and ready-made CMS platforms?

On website builders and ready-made CMS platforms such as Joomla or Shopify, first ask the platform’s support whether it lets you change the page HTML on the server, before it reaches the browser. If it does, your technical team builds the same rules right there. And don’t install a tool that lacks these rules just because it’s automatic!

How does internal linking with AI work?

AI (ChatGPT, Gemini, Claude) is very good at two internal linking jobs. One is building keyword groups from targeting you’ve done yourself, or from the targeting criteria you give it. The other is building these same rules and test cases into your site.

But don’t hand the decisions about the rules to AI! If you ask “How do I set up automatic internal links?”, you’ll get a different, incomplete answer every time. AI needs a defined method to follow, like the rules on this page. My ready-made skills do exactly that inside your own AI, and they’re available through Mohsen Tavoosi’s MCP.

Is there a ready-made brief for AI or a technical team?

Yes. Send this text, exactly as it is, to your AI or your technical team:

Build an automatic internal linking tool for this site. Each keyword group has one target URL and several keywords. All S, K, M, Z, L and C rules on the page mohsentavoosi.com/en/p-en/automate-internal-links-en are mandatory. S1 is the default, and M6 is on by default. Follow the eight link selection steps on that page. Before delivery, write every test case on that page as an automated test, and every test must pass. Include Export and Import in JSON.

Where can I get the full technical pack?

This page is written for reading and understanding. If you want your technical team to get started quickly, I’ve also put together a full technical pack. It includes the complete rules file in markdown (a plain text file with a clear structure), the test cases with the exact answer for each one, and the full implementation brief. I send it only to people who message me. Message me on Telegram and write “tech pack”.

What’s the next step?

Targeting first, then keyword groups, then automation! If you do it the other way around, all you’ve automated is wrong links. If you want to learn targeting properly, I teach it step by step in my SEO course.

And if you want to run these same methods with my ready-made skills inside your own AI, from targeting to building keyword groups, take a look at Mohsen Tavoosi’s MCP!

FAQ

What does automatic internal linking mean?

It means you decide once which page each keyword should link to, and the tool adds the link automatically wherever that keyword appears in your site’s text. A good tool has the rules on this page, such as linking only whole words, giving priority to the longer phrase and limiting links per page.

Can automatic internal linking hurt my site?

No, as long as the rules are followed! The damage comes from tools that lack these rules and, for example, add a link in the middle of a word or link to one page too many times. Each rule on this page prevents one of these mistakes. Before launch, test your keyword group on a single page as well!

What is a keyword group?

A keyword group is all the keywords and phrases that should link to one page, together with that page’s URL. For example, the keyword group for a security cameras page has that page’s URL and the phrases “security cameras”, “buy security cameras” and “CCTV cameras”.

Why should links be created only when the page loads?

Because the original text of your pages stays untouched, and switching the tool off removes the links at once. Writing links into the original text means keeping a before-and-after copy of every change so you have a way back. And restoring a backup wipes out every order and article added after it.

Can I use one keyword for two pages?

No! Each keyword belongs to one page, and the tool must reject a second entry with an error. If you have two pages for one intent, first decide whether they stay separate or get merged.

Why doesn’t a short phrase get a link inside a longer one?

Because the longer phrase’s spot is reserved for it. If “garage door” got a link inside “garage door opener”, it would link to the wrong page, and the long phrase would never get a link. A short phrase gets a link only where it appears on its own.

What does ZWNJ have to do with automatic internal linking?

Some languages, mostly those written in Arabic script, place an invisible character called ZWNJ between parts of a word, and the tool has to treat it like a space. That’s why there’s a checkbox for it, on by default. For languages where a space and a ZWNJ mean different things, you turn it off. On an English site, it changes nothing.

Will my manual links break?

No! If the link text is exactly the keyword and the URL is correct, the link stays as it is. A link whose text is longer than the keyword stays too, and nothing is linked inside it. Only a link whose text is exactly the keyword, but whose URL is different from the keyword group’s URL, gets the keyword group’s URL, since you defined the correct URL yourself in the keyword group.

How many links to one target page can a page get?

By default, one link per keyword group on each page, and all the keywords of one keyword group count together. You can change this limit. The limit inside each paragraph is set separately, and 0 means no limit.

What is a test case?

A test case is a specific example whose correct result is known in advance. For example, “book” must not get a link inside “notebook”. Your tool must produce the correct result for every example in the table, otherwise don’t turn it on for your site!

What should I do before launch?

First, back up the whole site and your keyword groups. Then test the keyword group on a single page and check it with View Source. After that, remove the limit, clear the cache and keep the switch that turns off every link within reach. The default settings are excellent and don’t need changes, unless the way your site works really calls for one.

How do I build this on custom code or a CMS?

These rules don’t depend on any platform. Your technical team places the linking part at the stage where the final page HTML is built, then runs the same eight steps and test cases. If you don’t have a technical team, give this page to AI, on the condition that it handles only the implementation.

My site runs on WordPress. Where do I start?

The free MT Smart Link Automation plugin runs these same rules and needs no coding. I explain installation and setup step by step on the WordPress internal linking plugin page.

Does automatic internal linking improve rankings?

I make no promises about rankings or results! A tool with these rules only creates correct, error-free links. Track the effect in Search Console, but if you see a change, just know that it happened at the same time as the links, not necessarily because of them.

I can’t code. How do I put these rules in place?

You don’t need to code! If your site runs on WordPress, installing my free plugin is enough. If it doesn’t, hand the rules to a technical team or to AI. AI should only follow the method I defined and not make its own decisions.

How should I build keyword groups?

Keyword groups have to come from keyword targeting, not guesses. First decide which page each keyword should target, then put every way of writing each intent into that page’s keyword group. I teach the targeting method in detail in my SEO course.

How do I get the full technical pack?

Message me on Telegram and write “tech pack”. The pack includes the complete rules file in markdown, the test cases with the exact answer for each one, and the full implementation brief.