Yoast is the most popular SEO plugin for WordPress sites. One of the built-in features it has is the automatic sitemap generation. It worked for my blog for a long time. However, all of a sudden, it stopped showing the CSS styling. It listed the links in plain text instead. And in Google Search Console, it displayed “We were unable to read your Sitemap” error.
This is what I saw when I tried to access it:
We were unable to read your Sitemap error in Google Search Console
Styling of the sitemap is for making the page readable for humans. I expected Google bots to be able to read it without issues but they couldn’t process the sitemap.
This is the error I ran into in Google Search Console when I submitted my Yoast sitemap URL:
Sitemap can be read, but has errors
We were unable to read your Sitemap. It may contain an entry we are unable to recognize. Please validate your Sitemap before resubmitting.
Root Cause of the Sitemap issue
The problem was the caching. I use Hummingbird to speed up pages by caching them. Apparently, the Yoast sitemap is not compatible with Humminbird’s caching algorithm.
Depending on the caching plugin you use, you may come across this issue if you don’t implement the solution in the next section.
Solution of We were unable to read your Sitemap error
Follow the steps below to solve this issue:
- Go to the Settings page of your caching plugin
- Find the Exclusions list. For Hummingbird, it’s right on the Caching page itself
- Add the following file names to the Exclusions list and click Save
Note: The plugin will add a backslash before each period automatically. For example, post-sitemap.xml will look like post-sitemap\.xml after saving the changes. This is okay. No need to make more changes.
After saving the changes, clear the cache and refresh the sitemap page. The styling should work without issues.
It should successfully fetch the links this time:
For generic information about Yoast XML sitemaps, check out this page.
If you are working with big XML files, one of my previous posts would be helpful: Working with big XML files