Creating a method to automate internal link building

Hello there awesome Hugo Community and thanks for indulging in my madness.

There’s been a similar thread in the past (Automatic Internal Linking based on Keywords), i’m wondering if something similar has been created in the mean time.

My goal would be to “emulate” a wordpress plugin which does automatize the internal link process (Internal Link Juicer: SEO Auto Linker for WordPress – WordPress plugin | WordPress.org), excluding the interface.

Since my skills are (very) limited (In Go in particular), i could try to:

  • Create an array of words to be linked and target internal pages
  • Check the {content} with Replace or ReplaceRe, replacing the first occurence of words with an internal link using ref or relref (Links and Cross References | Hugo)

During this planning stage i have many doubts:

  • the main one is related to the cross-reference: shoud i replace the matched word (eg: “banana”) with something like ({{< ref “article005.md” >}} “banana”)?
  • If the above point is true, my array should contain the word to the replaced and the filename of the linked article?

Sorry for the confusing post and thanks in advance !

check out taxonomies

I use it to create keyword lists in the meta section of the pages and to create lists for every word with a link to the tagged site.

IMHO content is best for SEO, forgett the other snake oil

1 Like

Interesting, thanks for the feedback!

I know! Content is always the priority :slight_smile: i’ve been doing SEO since 2002, when it was mostly “increase the keyword density and submit the site to many search engines using Submit wolf”.

Fortunately those times are now history :slight_smile:

But it’s not enough in many cases: so even without resorting to spammy tecniques, adding internal links is useful (Specyfikacje metatagu robots, atrybutu data-nosnippet i nagłówka HTTP X-Robots-Tag)

The problem is that when you have hundreds of articles it become increasingly difficult to do it, because it’s a procedure which is easy to do wrong.

my sample is here

free to copy anything :wink:

1 Like