Language sitemap code for blogger and website

Language sitemap code for blogger and website

 How to Create Language sitemap on Website ?

A language sitemap is a sitemap that includes a list of URLs for pages on a website that are available in different languages. The purpose of a language sitemap is to help search engines and users understand which pages are available in different languages, and to help them navigate to the appropriate version of the page.

Note: Replace  end part   ”> to ”/>

<?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>https://www.example.com/en/</loc>

    <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/”>

    <xhtml:link rel="alternate" hreflang="es" href="https://www.example.com/es/”>

    <xhtml:link rel="alternate" hreflang="fr" href="https://www.example.com/fr/”>

</url>

<url><loc>https://www.example.com/en/about-us/</loc>

<xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/about-us/”>

<xhtml:link rel="alternate" hreflang="es" href="https://www.example.com/es/sobre-nosotros/”>

<xhtml:link rel="alternate" hreflang="fr" href="https://www.example.com/fr/a-propos/”>

</url>

<url><loc>https://www.example.com/es/contacto/</loc>

<xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/contact/”>

<xhtml:link rel="alternate" hreflang="es" href="https://www.example.com/es/contacto/”>

<xhtml:link rel="alternate" hreflang="fr" href="https://www.example.com/fr/contact/”>

</url>

<url><loc>https://www.example.com/fr/produits/</loc>

<xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/products/”>

<xhtml:link rel="alternate" hreflang="es" href="https://www.example.com/es/productos/”>

<xhtml:link rel="alternate" hreflang="fr" href="https://www.example.com/fr/produits/”>

</url>

</urlset>

In this example, the loc element specifies the URL for each page, and the xhtml:link elements specify the alternate language versions of the page using the hreflang attribute. You can add additional pages and languages to the sitemap as needed. Note that the xhtml:link elements require the xmlns:xhtml namespace declaration to be included in the urlset element.

Other Completed Sample: 

<?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://example.com/page.html</loc>

    <xhtml:link rel="alternate" hreflang="en-US" href="http://us.example.com/page.html">

    <xhtml:link rel="alternate" hreflang="en-GB" href="http://uk.example.com/page.html">

<xhtml:link rel="alternate" hreflang="x-default" href="http://example.com/page.html">

</url>

<url><loc>http://us.example.com/page.html</loc>

<xhtml:link rel="alternate" hreflang="en-GB" href="http://uk.example.com/page.html">

<xhtml:link rel="alternate" hreflang="x-default" href="http://example.com/page.html">

<xhtml:link rel="alternate"hreflang="en-US" href="http://us.example.com/page.html">

</url>

<url><loc>http://uk.example.com/page.html</loc>

<xhtml:link rel="alternate" hreflang="en-US" href="http://us.example.com/page.html">

<xhtml:link rel="alternate" hreflang="x-default" href="http://example.com/page.html">

<xhtml:link rel="alternate" hreflang="en-GB" href="http://uk.example.com/page.html">

</url>

</urlset>

Comments

Popular posts from this blog

How to fix SSL Certificate Issues?

How to Fix Website Mixed Content Issues?

How to Fix Mobile Responsiveness Issues?

Popular posts from this blog

How to fix SSL Certificate Issues?

How to Fix Website Mixed Content Issues?

How to Fix Mobile Responsiveness Issues?