Hreflang code is overwritten by Webflow Locale setting


I’m not very familiar with SEO settings, so I’m not clear about the issue. My client is asking me to add a hreflang code at the end of the head tag of the site:

But it is not working. It seems that the localization setting has an automatic locale that overwrites the code. I can’t disable the primary locale. I don’t know what to do.

Here is my site Read-Only: Webflow - Revenue Excellence

1 Like

Hi there,

Webflow handles hreflang tags automatically through two methods:

  1. HTML page-level tags in the section
  2. Sitemap hreflang tags

To manage these settings, navigate to the Settings panel > Localization. Here you can:

  • Toggle automatic generation on/off
  • Choose to use the same base URL as the published/canonical URL
  • Enter a custom base URL if needed

For SEO purposes, you only need one signal to tell search engines about your localized pages - either page-level hreflang tags or entries in your auto-generated sitemap will suffice.

Hopefully this helps! If you still need assistance, please reply here so somebody from the community can help.

1 Like

Hi Daniel, localization handles the hreflang codes for you automatically, I wouldn’t recommend adding other codes as it would be misaligned with the main lang code.

What is it exactly that you’re trying to do? You can’t disable the primary locale, but you should be able to specify the locale’s country & language code sequence.

1 Like

Thanks for your replies. My understanding is that the hreflang tags code informs search engines which version of a page should show to the user based on their location. This seemed to be working fine a few months ago, and SEO managers had no complaints about it. Since the Webflow Localization feature was implemented, the code doesn’t work and all pages seem it point at the German location in several sites. This seems to be caused by the default (primary) locale (german). To set the English pages to the English locale, I need to change the sites plan, which would increase the monthly payment significantly. I don’t understand the value of this feature and, for that reason, I would like to disable it.

1 Like

I think I understand- you’re not using Webflow Localization, but you have a few pages on your site that are translated or that you’re planning to translate manually?

As far as I can see, because you are not using Webflow Localization, it is not generating any hreflangs on your site. There are none in your sitemap, however you do appear to have this in your site-wide code;

<!-- Language and location code -->
<link rel="alternate" hreflang="de" href="https://www.revenue-excellence.de" />
<link rel="alternate" hreflang="en" href="https://www.revenue-excellence.de/en" />
<link rel="alternate" hreflang="x-default" href="https://www.revenue-excellence.de" />

Which would affect all pages with the same hreflangs.

If you were translating e.g. the homepage only to English, you’d probably want this only in the homepage, and then you’d want to create an English translation of your homepage at /en

However you will have a problem - on all pages, your <html> element will have lang=de which would be incorrect for your English page(s). You might be able to turn that off site wide under your site dashboard settings, at the bottom of the General tab. However then none of your pages would correctly identify as lang=de either.

If you’re determined to avoid using Localization, I’d recommend, just create the pages you want and manually create your <link hreflang> tags for each page individually. You’ll have a mismatch on your English pages with the <html lang=de> but that’s relatively minor- modern search engines can clearly see your content is English.

1 Like

Thanks again for clarifying, but I still have issues:

First, I can’t disable the locale or set a language code for the site. Language code no has to be set on the Location settings. Which is by default DE.

Second, I added the code to the head code

because the idea was to set the hreflang to any page that matches any of the conditions. I thougth that, for example, this code would set Revenue Excellence Partners | sales agency for outbound & cold calling the hreflang=“en” because the URL starts with https://www.revenue-excellence.de/en/.
But what I think you are saying is that I have to set it individually for each page I created.

I tried that with the Revenue Excellence Partners | sales agency for outbound & cold calling

But the result was still DE:

I’m not sure what I’m doing wrong, but can’t find the work around Webflow location settings with code. Again, sorry that my knowledge on SEO is limited.

1 Like

Personally I would not use client-side scripts for this, because Google might run them depending on its mood, and no one else will, so you’re presenting inconsistent SEO signals.

If you really want to override Webflow’s HTML behavior I’d use a reverse proxy to fix your , hreflangs, and sitemap. But that’s a fair bit of infrastructure.

You could contact support to see if there’s some way to switch off the attribute.

But honestly for most clients I’d just recommend localization- it’s what you’re wanting so why hack together a 50% solution that you then have to maintain. Localization Essentials is fairly priced for the basics you need.

1 Like