I have used WordPress with the plugin to generate a sitemap on request (in my case it was "All In One SEO Pack"). In the beginning, everything worked fine, but at some moment I found that the sitemap is not available. There was an error "Extra content at the end of the document"
It can be a problem with a too small value of
max_execution_time. If your sitemap is too large, there is no enough time to generate it fully. Thus the document breaks in the middle.
You can add
ini_set('max_execution_time', 10); in
wp-config.php or add
max_execution_time = 1 in
Also, problem can be with extrace space before
<?php or after
?> in your