How to implement Hreflang through Sloth

How to implement Hreflang through Sloth

One of the first real-world use cases that we needed to solve with edge SEO was that of a travel industry client, with a big legacy tech stack and running ZXTMs for redirects (with line limits of less than 3,000).

The Hreflang case study also form a key part of our presentation at TechSEO Boost in November 2018.

A key part of the Sloth project was to make serverless applications such as Workers accessible to those who need them, including people who are not developers or competent in writing JavaScript.

Sloth Hreflang Manager

Sloth Hreflang manager has been designed to produce a self-sufficient worker bundle code that can be easily maintained without the need to touch a line of code.

Sloth Hreflang Manager

We have done this so that you can manage your Hreflang through:

  • CSV import & export
  • Line & row management in the Sloth dashboard

CSV import & export

Hreflang management

The CSV import and export manager we have tried to make as simple as possible, as well as being as scalable as possible. In order to format the CSV you need the following information:

  • The language/country codes that you are targeting
  • The URL paths for each of the alternate versions

It’s then a case of matching them up in the CSV and in the correct format. This being either as relative URL paths:

Sloth CSV Hreflang Manager Upload

Or as absolute URL paths (if you have multiple ccTLDs or different domains). The first row (column header) should declare your desired language-country, and then each corresponding row with the URL for that language-country combination.

Standard Hrelfang best practices apply, and URLs can be duplicated, if you’re using a URI path of /es-la/ for Latin America, with es-ar, es-co, es-mx et al for targeting.

Hreflang management in the Sloth dashboard

This is fairly self-explanatory, but we’ve built it to be manageable on scale. This works through adding in rows and columns via the green buttons, and removing columns via the red minus sign box, and removing rows via the trash cans.

Managing Hreflang in the Sloth user dashboard

In the column headers go the language-country codes, and in the rows go the corresponding URLs.

Does Google recognise the Hreflang?

As our research at TechSEO Boost revealed, Google is able to render a Hreflang implementation in the that’s being injected with Cloudflare Workers, and subsequent monitoring and tracking data has shown that they are respected – just like normal Hreflang.

Origin response v modified response