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.