core icon indicating copy to clipboard operation
core copied to clipboard

Update Starter to Use HREFLANG Blocks

Open stefan-dotcms opened this issue 2 years ago • 3 comments

User Story

As a content editor, I'd like to see that URLs are translated as well for translated pages, as I currently have this and it's impacting SEO.

Acceptance Criteria

Support URL translation

Proposed Objective

Sales

Proposed Priority

Priority 3 - Average

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Sub-Tasks & Estimates

No response

stefan-dotcms avatar Feb 01 '23 23:02 stefan-dotcms

I have some opinions on this. From experience, you don't take an SEO hit based on URL Slug translation.

I ran SEO and Localization at SolarWinds and we spent a year doing tests on translated pages. We never saw any meaningful boost when translating a URL Slug.

Your best gains from SEO will come from making sure a page is set up to share credit between the Default Language and Translated Language versions. You want to pump all your efforts into promoting the Default Language version (using a Canonical Tag), then list out the Translated Language locations using HREFLANG tags.

If you feel the need, having a translated URL Slug is an option, one good way to set it up is via a "Vanity URL" that 301 Redirects over to the default page.

Few Thoughts on Localization... we definitely need to be more opinionated with how this stuff is set up in the app. Looking at Sonnet's site, they have pieced together a way to make some things work, but they seldom follow best practices.

  1. Consistent URLs are Easy

If I wanted to have English and Spanish versions of a page, I should set them up to use a consistent URL structure for easier maintenance. This format seems to be common and I'd argue industry best practice.

mysite.com/en-us/some-page
mysite.com/es-us/some-page
  1. Pages should have the correct language tagged on them.
<html lang="en-us">
  1. Link your pages with an HREFLANG meta tag.

Both pages should have the same HREFLANG blocks.

<link rel="alternate" hreflang="en-us" href="https://mysite.com/en-us/some-page" />
<link rel="alternate" hreflang="es-us" href="https://mysite.com/es-us/some-page" />
  1. All pages should have the "default language" URL set as the Canonical URL.
<link rel="canonical" href="https://mysite.com/en-us/some-page" />
  1. HTTP Headers should contain the correct Language data for each page.

  2. Lastly, Locale-based Sitemaps Need to be Generated (and ideally declared with Google Webmaster Tools for faster adoption)

  3. It's OK to default content back to the primary language until it can be translated.

It's not ideal, but it's not a huge penalty. You can get a "misspelling" penalty -- so a page will come off as having a lot of typos and rankings will be slightly penalized in that language, but the pages are still generally usable.

damen-dotcms avatar Feb 02 '23 18:02 damen-dotcms

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar May 26 '23 01:05 github-actions[bot]

Repurposing this issue... Localized URLs will have to wait until we have completed the #24794 epic.

But... we do need to build out an example showing how HREFLANG blocks can work with the starter.

damen-dotcms avatar Feb 22 '24 17:02 damen-dotcms