Few days back I just faced an issue to generate SITEMAP.XML through “Yoast SEO plugin” on my website. So I searched on it and found that this issue was generating because of an outdated plugin which I wasn’t using on my website. So I just deactivated that plugin immediately and checked SITEMAP.XML. And now it’s working fine.
Here are some useful steps that we can follow for troubleshooting the issue:
- Uninstall the unnecessary or doubtful plugins one by one.
- If there is an empty line at the beginning (before the wp-config.php or functions.php file. Please remove it.