<link rel="alternate"> via standard_header_includes

I have created multilingual dynamic pages using HubDB.

For this I have a single set of HubDB tables with children that I am using on 3 pages:

  1. /en/categories
  2. /fr/categories
  3. /de/kategorien

I am noticing that on the /en and /fr pages standard_header_includes appears to be generating <link rel=“alternate” hreflang ..> tags. I suspect it is due to the fact that the directory below the language code is the same (ie. categories).

The issue is that those links are not correct, so I would like to remove them. How can I do this?

Hi, @lsmith77 :waving_hand: Thanks for your question. I’d like to invite some of our community experts to the conversation — hey @HFisher7 @Indrayani @Anton can you offer any insight or suggestions for @lsmith77’s project?

Thank you for taking a look! — Jaycee

Hi @lsmith77,

standard_header_includes cannot be altered or removed.

Can you confirm if the /en/, /fr/m and /de/ paths are manually added instead of using HubSpot’s multi-language variation tool?

The language subdirectories are added automatically by Hubspot.

My fix for now is to remove those links via a regex:

{{ standard_header_includes|regex_replace(“<link rel=\“alternate\” hreflang=\”[a-z]{2}\" href=\“.+>”, “”) }}