Yesterday after upgrading WordPress PHP to version 7.1 from 5.6, I suddenly noticed an issue with
Sitemap.xml file generated by
Yoast SEO plugin.
Well, let me mention first, there isn’t any issue with Yoast SEO plugin but something between the plugin and
PHP 7.1 version which I still haven’t figured it out.
If you own a WordPress site then absolutely I would recommend you upgrade site to PHP 7.1. I made a mistake not upgrading site to PHP 7.1 before. Speed improvements and performance gain you will get are tremendous.
Currently on Crunchify, Sitemap has been fixed by a quick workaround though.
Let’s get started on what happened:
Below are the sequence of changes I’ve performed yesterday.
- Updated PHP version to 7.1 via cPanel
- Updated WP Super Cache to latest version
- Using Yoast SEO 4.6 as of now
- Went to sitemap link which is
- Saw above
plain textsitemap on page 🙁
- Immediately after that I changed PHP version to 5.6 and issue resolved and it was rendering right.
But there was a problem. Speed performance and gain what we got by moving to PHP 7.1 was gone. So I switched backed PHP to 7.1 to debug further.
How did I fix this then?
- I disabled / enabled again few plugins but not luck.
- I noticed, sitemap files are cached using WP Super Cache plugin.
disabled cachingon Sitemap
Let me know if you find a permanent solution.