Managing a multilingual WordPress site can be challenging, especially when it comes to SEO. In this post, I will show you I how to fixed a sitemap issue when using The SEO Framework with Polylang
Understanding the Problem
The Initial Setup
Initially, my website was entirely in German, and I used The SEO Framework to manage SEO settings. However, when I decided to add an English version using Polylang, I saw a sitemap issue through Ahrefs tracking my Page.
The Sitemap Dilemma
The robots.txt showed a new entry for the english language. But it pointed to nothing and resulted into a 404 error
The Solution
Discovering the Correct Sitemap
I found that The SEO Framework automatically generates a sitemap for the English version at https://juliangeissler.de/sitemap.xml?lang=en.
Thanks The SEO Framework 😀
Implementing a Redirect
To fix the problem, I installed a redirect plugin. This allowed me to redirect requests from /en/sitemap.xml to the correct URL: /sitemap.xml?lang=en.
Step-by-Step Guide
Step 1: Verify Your Sitemaps on robots.txt
When installing e.g. Polylang to add multilanguage to your WordPress page check the robots.txt that all sitemap links generate an expected sitemap.xml file
I found this documentation of The SEO Framework but it didnt help me.
Step 3: If nothing helps install a Redirect Plugin
If the issue is still there like for me, install a redirect plugin like Redirection
Step 4: Set Up the Redirect
Configure the plugin to redirect /en/sitemap.xml to /sitemap.xml?lang=en. This ensures that search engines and users are directed to the correct sitemap.
By following these steps, you can effectively manage sitemaps for a multilingual WordPress site using The SEO Framework and Polylang. This not only resolves potential SEO issues but also enhances the overall user experience. Also make sure that you add both sitemaps to your Google Search Console.