• Hello,
    When trying to load a sitemap I always get the following error:

    This page contains the following errors:
    error on line 6 at column 6: XML declaration allowed only at the start of the document
    Below is a rendering of the page up to the first error.

    This says that there is a whitespace somewhere in a page, but where…
    I looked thru the config, functions, … but didn’t find anything.
    Can it be something else or is there a way to remove all whitespaces for sure?

    • This topic was modified 6 years, 5 months ago by rubenio1.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Moved to Fixing WordPress, this is not an Everything else WordPress topic.

    What plugin are you using to generate that sitemap_index.xml?

    Show source page.

    
    <html>
    <title>Convoy Security Group</title>
    <head>
    <meta name="description" content="Convoy Security Group, one of the first VTC's in TruckersMP with already 5 years experience!">
    <meta name="keywords" content="Convoy Security Group,ConSecGroup,CSG,VTC,TruckersMP,Convoy">
    <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//yourdomain/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
    <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    	<sitemap>
    		<loc>https://yourdomain/post-sitemap.xml</loc>
    	</sitemap>
    	<sitemap>
    		<loc>https://yourdomain/page-sitemap.xml</loc>
    		<lastmod>2019-12-09T12:38:39+00:00</lastmod>
    	</sitemap>
    	<sitemap>
    		<loc>https://yourdomain/oceanwp_library-sitemap.xml</loc>
    		<lastmod>2019-11-19T09:31:26+00:00</lastmod>
    	</sitemap>
    	<sitemap>
    		<loc>https://yourdomain/ocean_portfolio-sitemap.xml</loc>
    	</sitemap>
    	<sitemap>
    		<loc>https://yourdomain/author-sitemap.xml</loc>
    		<lastmod>2019-12-08T18:23:28+00:00</lastmod>
    	</sitemap>
    </sitemapindex>
    <!-- XML Sitemap generated by Yoast SEO -->

    A well formed xml file start with xml declaration.

    Thread Starter rubenio1

    (@rubenio1)

    I’m using: Yoast SEO. (but already tried multiple plugins, and none of them worked).
    (autotutorial: there is one before the first sitemap element. (<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">)

    • This reply was modified 6 years, 5 months ago by rubenio1.
    • This reply was modified 6 years, 5 months ago by rubenio1.

    https://en.wikipedia.org/wiki/Well-formed_document
    You can’t mix html markup with xml, you need to find which plugin adds html markup to an xml file.
    means an xml file must not start with html markup and optionally can have an xml declaration on the first line.

    Thread Starter rubenio1

    (@rubenio1)

    Do you think that it is another plugin which automatically adds that to every file? Or that the 2 plugins are coded wrong (which would be weird because it are 2 plugins with over 2 million downloads (there’re well known to say at least). @autotutorial

    yes, I think a plugin other than yoast Seo adds html markup to everything.

    Example of xml and declaratiion, well formed.

    <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//yourdomain/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
    <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    	<sitemap>
    		<loc>https://yourdomain/post-sitemap.xml</loc>
    	</sitemap>
    	<sitemap>
    		<loc>https://yourdomain/page-sitemap.xml</loc>
    		<lastmod>2019-12-09T12:38:39+00:00</lastmod>
    	</sitemap>
    	<sitemap>
    		<loc>https://yourdomain/oceanwp_library-sitemap.xml</loc>
    		<lastmod>2019-11-19T09:31:26+00:00</lastmod>
    	</sitemap>
    	<sitemap>
    		<loc>https://yourdomain/ocean_portfolio-sitemap.xml</loc>
    	</sitemap>
    	<sitemap>
    		<loc>https://yourdomain/author-sitemap.xml</loc>
    		<lastmod>2019-12-08T18:23:28+00:00</lastmod>
    	</sitemap>
    </sitemapindex>
    <!-- XML Sitemap generated by Yoast SEO -->
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Sitemap Not Working’ is closed to new replies.