<link rel="alternate"> via standard_header_includes

lsmith77
Contributor

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?

0 Upvotes
1 Accepted solution
lsmith77
Solution
Contributor

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=\".+>", "") }}

 

 

View solution in original post

3 Replies 3
GiantFocal
Top Contributor | Gold Partner
Top Contributor | Gold Partner

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?

Glad I could help.
Solving HubSpot puzzles is what we do.
Ernesto // GiantFocal


Found this answer helpful?
Marking it as the solution helps both the community and me - thanks in advance!
0 Upvotes
lsmith77
Solution
Contributor

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=\".+>", "") }}

 

 

Jaycee_Lewis
Thought Leader

Hi, @lsmith77 👋 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





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More