4

On our public gatsby website we have two languages: nl and en. Our default language is en, so we have /..., /en/... and /nl/....

So for one piece of content we have the following links:

Now, two of those are identical and all my SEO tools (like Ubersuggest, Hubspot, etc) are complaining about the duplicate title tags & content.

How should this be solved properly? Can we just redirect the /... pages to the /en/... without further SEO impact? And what's the best way to do redirects in Gatsby?

Stephen Ostermiller
  • 98,758
  • 18
  • 137
  • 361
Batist
  • 141
  • 2
  • maybe this link can help you: https://developers.google.com/search/docs/advanced/crawling/consolidate-duplicate-urls – Muhammad Dyas Yaskur Sep 22 '21 at 06:35
  • aha, thanks for the resource, seems like the gatsby gatsby-plugin-client-side-redirect module uses a 301 redirect, so that should probably do the trick! – Batist Sep 22 '21 at 07:04

1 Answers1

3

Regardless of redirects (Saw your comment), if you don't set hreflang annotations and canonicalize pages Google will likely consider them duplicates.

Via document <head>

<head>
 <title>Example.com</title>
  <link rel="alternate" hreflang="en-gb" href="http://en-gb.example.com/page.html" />
  <link rel="alternate" hreflang="en-us" href="http://en-us.example.com/page.html" />
  <link rel="alternate" hreflang="en" href="http://en.example.com/page.html" />
  <link rel="alternate" hreflang="de" href="http://de.example.com/page.html" />
 <link rel="alternate" hreflang="x-default" href="http://www.example.com/" />
</head>

Via headers

Link: <http://example.com/file.pdf>; rel="alternate"; hreflang="en",
      <http://de-ch.example.com/file.pdf>; rel="alternate"; hreflang="de-ch",
      <http://de.example.com/file.pdf>; rel="alternate"; hreflang="de"

Via sitemap.xml

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>http://www.example.com/english/page.html</loc>
    <xhtml:link
               rel="alternate"
               hreflang="de"
               href="http://www.example.com/deutsch/page.html"/>
    <xhtml:link
               rel="alternate"
               hreflang="de-ch"
               href="http://www.example.com/schweiz-deutsch/page.html"/>
    <xhtml:link
               rel="alternate"
               hreflang="en"
               href="http://www.example.com/english/page.html"/>
  </url>
...etc

This answer I wrote recently has some useful resources.

Mike Ciffone
  • 6,360
  • 5
  • 37