# Creating a method to automate internal link building

**URL:** <https://discourse.gohugo.io/t/creating-a-method-to-automate-internal-link-building/33992>\
**Category:** Uncategorized\
**Created:** [July 26, 2021, 8:49am UTC](https://discourse.gohugo.io/t/creating-a-method-to-automate-internal-link-building/33992 "2021-07-26T08:49:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr.poldoh](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@mr.poldoh](https://discourse.gohugo.io/u/mr.poldoh)\
**Post date:** [July 26, 2021, 8:49am UTC](https://discourse.gohugo.io/t/creating-a-method-to-automate-internal-link-building/33992/1 "2021-07-26T08:49:57Z")

</div>

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](https://discourse.gohugo.io/t/automatic-internal-linking-based-on-keywords/30615)), 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](https://wordpress.org/plugins/internal-links/)), 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](https://gohugo.io/extras/crossreferences/))

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 !

---

<div class="post-metadata">

**Author:** ![ju52](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ju52/32/6749_2.png) [@ju52](https://discourse.gohugo.io/u/ju52)\
**Post date:** [July 26, 2021, 12:41pm UTC](https://discourse.gohugo.io/t/creating-a-method-to-automate-internal-link-building/33992/2 "2021-07-26T12:41:34Z")

</div>

check out taxonomies

> **[Taxonomies](https://gohugo.io/content-management/taxonomies/)**
>
> Hugo includes support for user-defined 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

---

<div class="post-metadata">

**Author:** ![mr.poldoh](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@mr.poldoh](https://discourse.gohugo.io/u/mr.poldoh)\
**Post date:** [July 27, 2021, 1:56pm UTC](https://discourse.gohugo.io/t/creating-a-method-to-automate-internal-link-building/33992/3 "2021-07-27T13:56:17Z")

</div>

> [@ju52](#):
>
> 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.

Interesting, thanks for the feedback!

> [@ju52](#):
>
> IMHO content is best for SEO, forget the other snake oil

I know! Content is **always** the priority 🙂 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 🙂

But it’s not enough in many cases: so even without resorting to spammy tecniques, adding internal links is useful ([Robots Meta Tags Specifications | Google Search Central &nbsp;|&nbsp; Documentation &nbsp;|&nbsp; Google for Developers](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#noimageindex))

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.

---

<div class="post-metadata">

**Author:** ![ju52](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ju52/32/6749_2.png) [@ju52](https://discourse.gohugo.io/u/ju52)\
**Post date:** [July 27, 2021, 2:04pm UTC](https://discourse.gohugo.io/t/creating-a-method-to-automate-internal-link-building/33992/4 "2021-07-27T14:04:18Z")

</div>

my sample is here

> **[GitHub - gj52/HugoSample: Hugo Sample](https://github.com/gj52/HugoSample)**
>
> Hugo Sample. Contribute to gj52/HugoSample development by creating an account on GitHub.

free to copy anything 😉
