Solved – sitemap.xml error on line 2 at columna 1

After running WordPress and installing Jetpack, I encounter the following error when running the sitemap.xml of the website. The strangest thing was that the local server did work correctly.

I remembered that in local mode I had a similar error, which I fixed by removing the extra blank lines in the functions.php file after the “?>”, but this error was not the same:

«error on line 2 at column 1: Extra content at the end of the document” and looking at the source code it gave me: “<b>Fatal error</b>: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes ) in…»

Trawling the answer on san Google, I found the solution. The trick is to add to the “wp-config. php” the following line of code: «define( ‘WP_MEMORY_LIMIT’, ‘128M’ )».

That is, expand the memory to manage WordPress. We tested both the local server and the public server and it worked correctly and the sitemap did the same.

5/5 - 4 votes

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Politikaperu

Subscribe now to keep reading and get access to the full archive.

Continue reading