StevenTed
Newbie
- Mar 13, 2024
- 43
- 10
Hello everyone, I have a multilingual website coded by my team. We are wondering how to design a sitemap properly.
Currently there are 2 options.
- The first is to create multiple sitemaps, one for each language. But I wonder if every time there is a new post, I have to update it manually?
- The second option is to use only one sitemap and use the "hreflang" tag. I did, but it doesn't seem to work
Here is the example I used:
<?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://name.com/refund-policy</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://name.com/refund-policy"/>
<xhtml:link rel="alternate" hreflang="zh" href="https://name.com/zh/refund-policy"/>
<xhtml:link rel="alternate" hreflang="es" href="https://name.com/es/refund-policy"/>
<xhtml:link rel="alternate" hreflang="ru" href="https://name.com/ru/refund-policy"/>
<xhtml:link rel="alternate" hreflang="x-default" ref="https://name.com/en/refund-policy"/>
</url>
......
</urlset>
I need everyone's help. Thank
Currently there are 2 options.
- The first is to create multiple sitemaps, one for each language. But I wonder if every time there is a new post, I have to update it manually?
- The second option is to use only one sitemap and use the "hreflang" tag. I did, but it doesn't seem to work
Here is the example I used:
<?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://name.com/refund-policy</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://name.com/refund-policy"/>
<xhtml:link rel="alternate" hreflang="zh" href="https://name.com/zh/refund-policy"/>
<xhtml:link rel="alternate" hreflang="es" href="https://name.com/es/refund-policy"/>
<xhtml:link rel="alternate" hreflang="ru" href="https://name.com/ru/refund-policy"/>
<xhtml:link rel="alternate" hreflang="x-default" ref="https://name.com/en/refund-policy"/>
</url>
......
</urlset>
I need everyone's help. Thank