How to Create a Multilingual Sitemap in WordPress with WPML or Polylang

Creating a multilingual sitemap for your WordPress site is a great way to help Google and other search engines effectively crawl all the content on your multilingual website. A well-structured XML sitemap should include each individual page on your website, as well as how those pages relate to each other when localized in different language.

Multilingual sitemap is an important technical aspect of multilingual SEO strategy, which involves with content translation, URL optimization and more. In this article, we'll show you how to create it and how to submit it to search engines.

Why is multilingual SEO important?

Multilingual SEO enables businesses to reach new audiences by improving their SEO rankings in specific regions and countries. By providing content in multiple languages, the chance of appearing in relevant search results and attracting organic traffic from international audiences is increased. And you can connect with potential customers who prefer to browse and make purchases in their native language.

Furthermore, multilingual SEO contributes to an improved user experience. Visitors are more likely to engage with a website that is available in their native language, as it creates a sense of familiarity and trust. It also eliminates the need for users to rely on automatic translations, ensuring the accuracy and clarity of the content.

Multilingual SEO is opposite to local SEO, where you target to users in the local area, near or around your business location.

Implementing multilingual SEO in WordPress requires you to install a multiligual plugin and use it to translate content in different languages. This plugin also helps you to generate different URLs for each page on your website.

However, most multilingual WordPress plugins don't generate XML sitemap for you. So you have to do it yourself or use a SEO plugin to handle that. Let's find out in this article.

What is a multilingual sitemap?

A sitemap is a file that lists all the URLs of your website in the XML format with important metadata about each page, such as its last modification date and priority. It helps search engines understand the structure and content of a website, making it easier for them to crawl and index the pages.

By submitting an XML sitemap to search engines, website owners can ensure that all relevant pages are discovered and included in search engine result.

A multilingual sitemap is a specialized type of sitemap that includes URLs and relevant metadata for multiple language versions of a website. It is designed to help search engines and users navigate and understand the multilingual content of a website.

Why you need a multilingual sitemap in WordPress?

By providing language-specific URLs and annotations, a multilingual sitemap assists search engines in correctly indexing and displaying the appropriate language version of a webpage in search results. This ensures a seamless user experience for visitors from different language backgrounds and enhances the overall visibility and accessibility of a multilingual website.

A multilingual sitemap in WordPress is crucial for SEO as it ensures your multilingual content is properly indexed by search engines. By including a multilingual sitemap, you make it easier for search engine crawlers to discover all the translated versions of a page.

This increases the likelihood of your content appearing in relevant search results for users searching in their native language and enhances the overall visibility and accessibility of a multilingual website.

WordPress multilingual plugins: WPML and Polylang

When it comes to creating a multilingual website on WordPress, two popular plugins, WPML and Polylang, offer a range of features and functionalities to make the process easier. Let's take a closer look at each plugin and their ease of use.

WPML

WPML: the WordPress multilingual plugin

WPML is a robust plugin that offers advanced features for creating multilingual websites. With WPML, you can create language-specific versions of your posts, pages, and custom post types, as well as translate various elements such as menus, widgets, and theme options.

The plugin offers a user-friendly interface and integrates seamlessly with popular page builders and WooCommerce. It also offers premium add-ons for additional functionality, such as automatic translations and the ability to connect with professional translation services.

While WPML undoubtedly offers extensive capabilities, its wide range of features may make it a bit more complex for beginners.

Polylang

Polylang: Free WordPress translation plugin

On the other hand, Polylang is a lightweight and user-friendly plugin that aims to simplify the process of creating multilingual websites. It allows users to translate their posts, pages, categories, and tags into multiple languages.

Polylang offers an intuitive language switcher, which makes it easy for visitors to switch between language versions. Polylang is known for its simplicity and ease of use, making it an excellent choice for beginners.

There are more multilingual plugins for WordPress, but we don't cover all of them in this article. For details about these plugins and their comparison, please see: Top 7 Multilingual Plugins For WordPress - Complete Reviews.

Creating XML sitemap for a multilingual site

When talking about multilingual XML sitemap, most people think about a separate sitemap for each language on your website. Each sitemap will contains all the links of pages on your site that are translated to that language.

This is one approach to create multilingual sitemaps. With this method, you have to submit multiple sitemaps to Google Search Console to make sure all URLs are crawled.

However, there's another way to create a multilingual sitemap by adding alternate links of posts for languages in your existing XML sitemap. This method allows you to use only one sitemap for all languages, so you don't have to submit multiple sitemaps to Google Search Console.

The second method is used by the Slim SEO plugin and the plugin automates all the process for us, which saves us a lot of time configuring the sitemap for a multilingual site.

To start, simply install Slim SEO within your WordPress dashboard.

Installing Slim SEO within your WordPress dashboard

One of the best things about Slim SEO is that it automates all your SEO tasks. For XML sitemap, Slim SEO automatically creates a sitemap at the URL https://yourdomain.com/sitemap.xml. This sitemaps contains all links to your posts, pages or custom post types, and also taxonomy terms.

The best thing about this XML sitemap is that when you use Slim SEO with WPML or Polylang, it will automatically add alternative language URLs for your posts. So, when you view the source of the sitemap page, you will see something like:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://yourdomain.com/wp-content/plugins/slim-seo/src/Sitemaps/style.xsl"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:xhtml="http://www.w3.org/1999/xhtml">
	<url>
		<loc>https://yourdomain.com/</loc>
		<lastmod>2023-07-07T13:55:53+00:00</lastmod>
		<xhtml:link rel="alternate" hreflang="en" href="https://yourdomain.com/"/>
		<xhtml:link rel="alternate" hreflang="fr" href="https://yourdomain.com/fr/"/>
	</url>
</urlset>

As you can see, the plugin add rel="alternate" for each language for each post in the sitemap. In this example the homepage has 2 version: English version (original) and French version (translated). So, when the search engines view the sitemap, it see all links of your multilingual posts. These links are not visible to human, but you can see it when you view the source code of the sitemap.

This way, when search engine bots crawl your sitemap, they'll see all URLs for all languages and crawl the corresponding pages to index them.

Submitting XML sitemaps to search engines

Submitting XML sitemaps to search engines, such as Google and Bing, is the next step in optimizing your website for better indexing and improved search engine rankings. By submitting your XML sitemap to search engines, you're giving them a clear roadmap of your website's structure and language versions.

If you're already done this, you can bypass this step. Slim SEO doesn't add more sitemap URLs, so you don't have to submit again.

If you haven't submitted your sitemap, please follow the steps below.

Submit multilingual sitemap to Google

Google Search Console is a free SEO tool from Google. Like Google Analytics, it's a must-use tool for all SEOer and website owners. Google Search Console tells you which keywords your website rank for, how many back links your website has, SEO errors that you need to fix and more.

To submit your sitemap in Google Search Console, go to Sitemaps and enter your sitemap URL:

Add your sitemap to Google Search Console

In this case, as you're using Slim SEO, the sitemap URL is: http://yourdomain.com/sitemap.xml.

Submit multilingual sitemap to Bing Webmaster Tools

Similar to Google Search Console, Bing Webmaster Tools is the place where Bing (the 2nd popular search engine) learn about your website. It provides a similar tools such as submitting sitemap, tracking queries, etc. It's important to add your site to Bing Webmaster Tools, so your site is visible on Bing.

To submit your XML sitemap, click on your website in the Bing Webmaster Tools dashboard to go to your site settings:

Submit a sitemap in Bing Webmaster Tools

Click the Submit a sitemap button and enter the sitemap URL to the input box.

Submit your multilingual XML sitemap to Bing Webmaster Tools

Again, as you're using Slim SEO, the sitemap URL is: http://yourdomain.com/sitemap.xml.

For details about adding your websites and sitemaps to Google Search Console and Bing Webmaster Tools, please see: SEO Checklist For New Websites: A Complete Guide.

Conclusion

Creating and submitting a multilingual sitemap in WordPress is now easier than ever before. Slim SEO automates the whole task that would follow Google's exact specifications. This means you don't have to worry about manually creating an XML document from scratch which can be time-consuming. Moreover, once your site is translated into multiple languages, this plugin will automatically update your sitemap to reflect the new changes.

Being able to keep up-to-date with the latest SEO trends and website updates, having a multilingual sitemap in WordPress is a must. This helps search engines understand and serve the correct language version to your target audience, ultimately improving your organic search visibility and driving more traffic to your site.

5 comments

  1. I'm using the free version of your awesome plugin "slim SEO"
    What if I have polylang installed but my sitemap.xml is not reproducing the behavior that you describe in this article? When I load the url, I only see the main language pages, and when I inspect the source code for the xml file, there's no way to find these alternate links for the other languages...
    Pages (both languages) are linked properly in order to serve the correct language to the visitor... So I'm not thinking that a misconfiguration of Polylang could be the cause.
    Is there any way to refresh or re-do the sitemap?
    How can I assure the right generation of the sitemap?

  2. Have you checked the "sitemap-post-type-post.xml" sitemap? The main sitemap.xml is an index of sub-sitemaps, which doesn't contain the URLs of other languages. Only sub-sitemaps for post types contain them.

  3. Hi Anh, thanks for your quick answer.
    Yes, I'm aware of what you say. Actually, I'm checking "sitemap-post-type-page.xml" file, since in my website only pages are translated, and there are no posts published.

  4. Finally, with the help of SlimSEO's support staff, I must confirm that everything was working perfectly and the multilingual sitemap was built flawlessly. My confusion was caused by trying to view the alternate links, using Chrome's web inspector, convinced that I was consulting the source code. It wasn't until I printed the source code that I saw the alternate links were indeed there.
    So, I must say: problem solved! Thank you and I apologize for my confusion.

Leave a Reply

Your email address will not be published. Required fields are marked *