@tuhinbiswas98 We checked on the post sitemaps that aren’t working and they are returning a 500 error. Also, the ones that are working seem to be taking a fairly long time to generate. This makes us suspect that the sitemaps that are returning a 500 error are being caused by that the server resource limits are being reached before the sitemap’s generation is completed.
To resolve this, we would first recommend ensuring that the PHP settings for both max_execution_time
and memory_limit
are set to a high enough value in the PHP environment. This setting is typically controlled by editing the values in a php.ini file such as in the following example:
max_execution_time = 300
memory_limit = 256M
If you aren’t sure how to change these settings in php.ini, we would recommend contacting your hosting provider for additional assistance.
If you are still receiving a 500 error after increasing the PHP memory and execution time, the issue may be caused by that the PHP script run time restriction on the server is being reached. In order to reduce the amount of time necessary for the script to generate the sitemap, you can reduce the number of entries in the sitemap.
By default, the number of entries in the sitemap is set to 1000 but by decreasing this value it will decrease the amount of resources required to generate the sitemap. To decrease the number of sitemap entries you can use the filter wpseo_sitemap_entries_per_page
. We have more information on using this developer filter at the following link: https://kb.yoast.com/kb/enable-xml-sitemaps-in-the-wordpress-seo-plugin/#limit