No language code in posts permalink in multilingual site

I have a multilingual site, nl and en. The nl-blog archive is in /blog, the en-blog archive is in /en/blog. Like it should.

My permalinks for nl are like: /2021/10/08/nederlands-bericht/ and for English: /en/2021/10/08/english-post/.

However… I want the permalinks to posts NOT have the language code prefix. So the posts should have:


In a nutshell: I’d like to get rid of the language prefix in my post permalinks.

How can I achieve this?

Relevant config.toml:

  blog = "/:year/:month/:day/:slug/"
  blog = "/:year/:month/:day/:slug/"

Multilingual mode is global. If your request was possible Hugo would not know which one would be the corresponding translation of a given content file.

As far as I know you can achieve what you want without using multilingual mode.

You could use two different Sections:
/blog and /en

And then configure the permalinks like so:

    blog = "/:year/:month/:day/:slug/"
    en = "/:year/:month/:day/:slug/"

Thanks. That workaround would do the job, but I prefer to keep my posts in one place/folder.

Thing is, I blog mostly in my primary language, but sometimes in English. So, the posts never are translations of eachother. (And if they are, their title and slug will be different, so it shouldn’t be an issue.)

So my requirements are:

  • All posts in one section “posts
  • All posts are in a bundle
  • Dutch posts are in and English posts are in
  • List pages (homepage, section page, taxonomies etc.) permalinks are in their language folder (e.g. /tags for Dutch and /en/tags for English
  • static pages (about etc.) permalinks are in their language folder (e.g. /over for Dutch and /en/about for English
  • Permalinks for Dutch posts (in “posts” section) are in the site root ("/:year/:month/:day/:slug/")
  • Permalinks for English posts (in “posts” section) are in the site root ("/:year/:month/:day/:slug/")

Files in content folder:
+-- 2021
    +-- 10
        +-- nederlands-bericht
        +-- english-post
        +-- etc.

URLs / permalinks      <== root  <== static page  <== list page  <== blog post

You will still need to remove the multilingual mode. Since you are posting different content per language you do not really need it and you cannot remove the lang code from the second language as noted above.

So with the setup you described just try:

    posts = "/:year/:month/:day/:slug/"

So that /posts/ is not included in the permalink.

And also make sure to use for your english language blog posts (and not

The bundle directory of an english language post should have an english language name and that should be enough to differentiate it from the dutch ones.

Thanks for your contribution. I’ll give this some thought.