instead of: {{ with .Params.canonical }} <link rel="canonical" href="{{ . }}" itemprop="url" /> {{ end }} which only works if you set a non empty property for "canonical" property Use this: {{ if .Params.canonical.enable }} {{ with .Params.canonical.link }} <link rel="canonical" href="{{ . | relLangURL }}" itemprop="url" /> {{ else }} <link rel="canonical" href="{{ .Permalink }}" itemprop="url" /> {{ end }} {{ end }} it gives the user a choice wheather or not to have a canonical tag (which by default is the page itself) or to add a URL to another page.