has anyone tried applying hreflangs to cms blog pages only to selected pages ??
I am trying to add hreflangs to the cms blog’s page of my site.
There are three websites for : singapore, hong kong and japan. But not all blogs are related … So I want to add hreflangs only to a few blog pages … How can we do that ?
The webflow rich text field accepts custom code but i have to place it inside the page with in head tags this is creating two head tags and the hreflangs are nolt working properly.
The cms page head tags doesn’t allow a rich text field…
Google is good at processing custom script, especially if it’s synchronous- so the typical approach here is to write custom code that will generate those.
Another option ( a bit of a hack ) is to e.g. create 6 fields in the CMS, e.g.;
Hreflang 1 - option field, with choices alternate or ignore
Hreflang Code 1 - text field
Hreflang Url 1 - link field
Hreflang 2 - option field, with choices alternate or ignore
Hreflang Code 2 - text field
Hreflang Url 2 - link field
Hreflang 3 - option field, with choices alternate or ignore
Being able to choose between alternate and ignore for each item determines whether it’s a language alternate or just a meaningless link that searchbots will ignore.
If you populated all 3, and set them all to alternate, you’d get;
Hi Varun, not sure what you’re saying exactly. You might need examples.
However I generally use script rather than these types of hacks.
You don’t need to worry about errors on irrelevant tags, because they’re irrelevant. It’s just saying “I’m not sure what you’re trying to do here,” and you’re trying to do absolutely nothing, so that’s perfect
sorry if i was not clear in the explaining the issue.
my client is actually using this toll to check for hreflangs and its showing errors for the ignore tags link to the tool
if it doesn’t effect SEO then we would ignore it … but can you please share any scripts you are using other than the code you had previously shared… might as well test that out
We write the code for each client individually depending on their site & CMS design and SEO needs, so there is nothing generic to share. However if you’re wanting to take a code approach yourself you should find lots of examples on Google.
I tried a couple of codes but all of them showed error in the tool. or just weren’t working
your approach was the only thing that worked for the CMS without too many complexity…
anyways will discuss with the SEO team and try to come up with a solution or let it remain as it is.
thanks for all your support …your solution helped me add the hreflangs on the blogs that need them… really appreciate it michael
Tools like AHREFs do not process pages the way Google does, so the will not execute the script. Google uses a headless chromium instance to evaluate page JS before parsing it.
So in short those tools won’t like it, but that’s not relevant to your SEO. It only matters what Google thinks.