Configuring Multi-Language Website SEO with Hugo

Translating your Hugo website can improve your Google and Bing ranking – but only if the translated content is high quality, localized, and properly structured for multilingual SEO.

Localized pages (not just translated, but culturally adapted) often r…


This content originally appeared on DEV Community and was authored by Rost

Translating your Hugo website can improve your Google and Bing ranking - but only if the translated content is high quality, localized, and properly structured for multilingual SEO.

Localized pages (not just translated, but culturally adapted) often reduce bounce rates, increase time-on-site and improve conversions. These are user behavior signals that can positively affect your SEO rankings.

Hugo is a static website generator. In the essence it converts the Markdown files to Html pages in a very configurable way and is pretty fast. For the details please see here

Main question: Should You Translate for SEO?

reasons table

Required HTML for sites with literal (automated) translations

  1. Each page must have lang attribute in html tag, for example:
<html lang="de">
  1. Each page must have list of alternative links for this page in other languages, for example, html below is descibing alternative urls for same or similar page in three languages:
<link rel="alternate" hreflang="en" href="https://www.glukhov.org/post/2025/10/multi-language-website-seo-with-hugo/">
<link rel="alternate" hreflang="de" href="https://www.glukhov.org/de/post/2025/10/multi-language-website-seo-with-hugo/">
<link rel="alternate" hreflang="ru" href="https://www.glukhov.org/ru/post/2025/10/multi-language-website-seo-with-hugo/">
  1. Each translated website page must specify canonical url for this page (the one in first or language of original page), like:
<link rel="canonical" href="https://www.glukhov.org/post/2025/10/multi-language-website-seo-with-hugo/">

This will advise search engines to skip indexing non-canonical pages.
Some search engines of course can ignore this, and index all pages.

For professionally / manually translated web page

Not specifying <link rel="canonical" can cause search engine to impose duplication penalties.
But if you do manual translation of your website pages, or order professional one, you can hope search engines would accept your non-canonical page as original.

Hugo templates for localized websites

We should keep in mind that the Hugo website theme
might be supporting all this already.

<html lang=...

Open file layouts/_default/baseof.html either in your Hugo website folder or your theme's folder and make sure there is something like:

<!DOCTYPE html>
<html class="no-js" lang="{{ .Site.Language.Lang }}">
<head>
...
    {{ partial "seo-localise.html" . }} 
</head>
...

<link rel="alternate" hreflang= and <link rel="canonical"

Now open file layouts/partials/seo-localise.html and put there this html template code:

{{ $defaultLang := .Site.Params.defaultContentLanguage | default "en" }}
{{ $canonical := .Permalink }}

{{ if .IsTranslated }}
  {{ $original := .Translations.GetByLang $defaultLang }}
  {{ if $original }}
    {{ $canonical = $original.Permalink }}
  {{ end }}

{{ end }}

<!-- Canonical URL -->
<link rel="canonical" href="{{ $canonical }}">

<!-- Hreflang Alternate Tags -->
{{ range .AllTranslations }}
    <link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}">
{{ end }}

If you translate your website manually, this code might be looking like

{{ $canonical := .Permalink }}

<!-- Canonical URL -->
<link rel="canonical" href="{{ $canonical }}">

<!-- Hreflang Alternate Tags -->
{{ range .AllTranslations }}
    <link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}">
{{ end }}

Now execute hugo command to generate a website, then hugo serve to run developer web site host, open website and view a page source.
Make sure all those <html> and <link> tags have proper attributes.


This content originally appeared on DEV Community and was authored by Rost


Print Share Comment Cite Upload Translate Updates
APA

Rost | Sciencx (2025-10-04T10:50:54+00:00) Configuring Multi-Language Website SEO with Hugo. Retrieved from https://www.scien.cx/2025/10/04/configuring-multi-language-website-seo-with-hugo/

MLA
" » Configuring Multi-Language Website SEO with Hugo." Rost | Sciencx - Saturday October 4, 2025, https://www.scien.cx/2025/10/04/configuring-multi-language-website-seo-with-hugo/
HARVARD
Rost | Sciencx Saturday October 4, 2025 » Configuring Multi-Language Website SEO with Hugo., viewed ,<https://www.scien.cx/2025/10/04/configuring-multi-language-website-seo-with-hugo/>
VANCOUVER
Rost | Sciencx - » Configuring Multi-Language Website SEO with Hugo. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/04/configuring-multi-language-website-seo-with-hugo/
CHICAGO
" » Configuring Multi-Language Website SEO with Hugo." Rost | Sciencx - Accessed . https://www.scien.cx/2025/10/04/configuring-multi-language-website-seo-with-hugo/
IEEE
" » Configuring Multi-Language Website SEO with Hugo." Rost | Sciencx [Online]. Available: https://www.scien.cx/2025/10/04/configuring-multi-language-website-seo-with-hugo/. [Accessed: ]
rf:citation
» Configuring Multi-Language Website SEO with Hugo | Rost | Sciencx | https://www.scien.cx/2025/10/04/configuring-multi-language-website-seo-with-hugo/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.