1

I have a multi language website for my company.

my language routing goes like example.com/[language]. I have 2 languages, and my URLs are example.com/tr,example.com/en, and example.com/ redirects to example.com/en.

so example.com/ and example.com/en are counted as the same URL, so google chooses to rank example.com/ and exclude example.com/en although example.com/en is included in the sitemap and example.com/ is not.

the problem here is now example.com/ is not counted as an only en URL although it does redirect to the /en, so now in the search results example.com/ (which redirects to en) will appear on top disregarding the language of the user.

I could not see an option to exclude the root URL anywhere, and google indexed it although it is not included in the sitemap. How can I overcome this?

Stephen Ostermiller
  • 98,758
  • 18
  • 137
  • 361
Adnan
  • 121
  • 3
  • How long has the root URL been redirecting to a language subdomain? Sometimes it takes Google a few weeks to sort it out. So if you recently implemented that, you may just need to give it time. – Stephen Ostermiller Apr 21 '22 at 11:48

1 Answers1

1

According to Google Developers' documentation, you can add localized equivalent for each page

so my sitemap went from

<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
  <loc>https://example.com/en</loc>
  <lastmod>2022-03-22T06:34:05+00:00</lastmod>
  <priority>1.00</priority>
</url>
<url>
  <loc>https://example.com/en/products</loc>
  <lastmod>2022-03-22T06:34:05+00:00</lastmod>
  <priority>0.80</priority>
</url>
<url>
  <loc>https://example.com/en/about</loc>
  <lastmod>2022-03-22T06:34:05+00:00</lastmod>
  <priority>0.80</priority>
</url>
<url>
  <loc>https://example.com/tr</loc>
  <lastmod>2022-03-22T06:34:05+00:00</lastmod>
  <priority>1.00</priority>
</url>
<url>
  <loc>https://example.com/tr/urunler</loc>
  <lastmod>2022-03-22T06:34:05+00:00</lastmod>
  <priority>0.80</priority>
</url>
<url>
  <loc>https://example.com/tr/hakkimizda</loc>
  <lastmod>2022-03-22T06:34:05+00:00</lastmod>
  <priority>0.80</priority>
</url>

</urlset>

to:

<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
      xmlns:xhtml="http://www.w3.org/1999/xhtml">

<url> <loc>https://example.com/</loc> <xhtml:link rel="alternate" hreflang="tr" href="https://example.com/tr"/> <lastmod>2022-04-21T09:09:08+03:00</lastmod> <priority>1.00</priority> </url> <url> <loc>https://example.com/en/products</loc> <xhtml:link rel="alternate" hreflang="tr" href="https://example.com/tr/urunler"/> <lastmod>2022-04-21T09:09:08+03:00</lastmod> <priority>0.80</priority> </url> <url> <loc>https://example.com/en/about</loc> <xhtml:link rel="alternate" hreflang="tr" href="https://example.com/tr/hakkimizda"/> <lastmod>2022-04-21T09:09:08+03:00</lastmod> <priority>0.80</priority> </url>

</urlset>

in the new version please notice that we've added xmlns:xhtml tag to the urlset, to be able to process xhtml:link tags.

I'm not sure this will work, so I will come back later after the new sitemap has been indexed!

Stephen Ostermiller
  • 98,758
  • 18
  • 137
  • 361
Adnan
  • 121
  • 3