1

I have created an xml sitemap. I have used Google SearchConsole to send it in, but the SearchConsole status says it can not be fetched. I cannot see why. Anyone who can spot the error, or have some kind of method or work-around for letting Google find my sitemap? I have even added the sitemap path to my robots file. And the same day I did the exact same thing on another new website I'm working on, and it worked without any problems, so I can't understand what's wrong with this sitemap.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>https://www.ortocare.dk/</loc>
        <lastmod>2019-02-05</lastmod>
    </url>
    <url>
        <loc>https://www.ortocare.dk/behandlinger/prf.php</loc>
        <lastmod>2019-02-05</lastmod>
    </url>
    <url>
        <loc>https://www.ortocare.dk/ydelser/speciallaegeerklaering.php</loc>
        <lastmod>2019-02-05</lastmod>
    </url>
    <url>
        <loc>https://www.ortocare.dk/ydelser/funktionsattest.php</loc>
        <lastmod>2019-02-05</lastmod>
    </url>
    <url>
        <loc>https://www.ortocare.dk/ydelser/second-opinion.php</loc>
        <lastmod>2019-02-05</lastmod>
    </url>
    <url>
        <loc>https://www.ortocare.dk/prisliste.php</loc>
        <lastmod>2019-02-05</lastmod>
    </url>
    <url>
        <loc>https://www.ortocare.dk/om-klinikken.php</loc>
        <lastmod>2019-02-05</lastmod>
    </url>
    <url>
        <loc>https://www.ortocare.dk/kontakt.php</loc>
        <lastmod>2019-02-05</lastmod>
    </url>
</urlset>

A httpstatus checker returns 200 OK and Content-Type Application/XML. And both sitemap.xml and robots.txt checks out fine in some online tests.

User-agent: *
Sitemap: https://www.ortocare.dk/sitemap.xml
Disallow: /robots.txt$
Disallow: /login
  • It's very hard to tell without having access to the sitemap file itself and some additional background like the contents of your robots.txt file. Have you tried an HTTP header checker to see what type of response it's sending? Can you post your robots.txt contents here, and have you tried using Google's robots.txt tester? support.google.com/webmasters/answer/6062598?hl=en – WebElaine Feb 6 at 19:54
  • I posted a link to the sitemap, but apparently this is not allowed (it was edited away). I will see if I can edit my post to include sitemap content and robots.txt content in anonymized form. – niels Feb 6 at 21:55
  • It didn't work out well when I tried to post the content. Don't know how to show the content then, without link to the actual file, whch apparently is not allowed. I think I will ask some Google help directly instead, sorry. – niels Feb 6 at 22:08
  • You can paste the file's contents into the question, then select/highlight all of the code, and press the {} code button which will format it to appear in a gray box. – WebElaine Feb 6 at 22:55
  • Checked and pasted - thanks WebElaine. I still can't find the error, except there might be a bug in the new Google SearchConsole? – niels Feb 7 at 10:38
1

Your robots.txt lists the sitemap at:

http://www.example.dk/sitemap.xml

However, your site seems to be secure, and your sitemap actually redirects to:

https://www.example.dk/sitemap.xml

(I'm preemptively replacing your actual URL with a stand-in, to follow the rules.)

If you're submitting the http version, that could be an issue. Try submitting the https URL in GSC. Also, make sure you register both versions in GSC, and set the secure one as canonical / main version. Finally, update all the URL's in your sitemap to the secure versions, to avoid getting the non-secure ones into the index.

Separately, feel free to delete the following line from your robots.txt:

Allow: /

as it is redundant; you've disallowed two pages, everything else is allowed by default.

  • Good point about the Allow directive. I have now removed it. And yesterday I changed the whole thing from http to https, so I have now edited the code in my original question. Every suggestion here, I have carried out in GSC, but still status "Can't fetch". Maybe I just need to be patient (not one of my core competencies) and try again in a few weeks. :-( – niels Feb 8 at 9:30
  • @niels Interesting. Okay, try using GSC's Fetch As Google feature on the sitemap URL itself, sometimes that turns up the issue. Also, your sitemap URL returns a 304 response. That means redirection to a cached version of the requested resource is taking place. Try emptying all server side cache and then resubmit in GSC. – Henry Visotski Feb 8 at 15:36
0

Submit your sitemap in https:// version and it will be validated successfully. If you are using http:// then you have to fix your sitemap format which is currently wrong.

You can validate your sitemap here: https://www.xml-sitemaps.com/validate-xml-sitemap.html

If you want to fix the problem in http version, refer to this screenshot:

Wrong Format - Sitemap

  • Aah - content header. I checked that from the beginning, but it must have changed along the way. Maybe some editor I'm using... Thanks a bundle! – niels Feb 8 at 9:36
  • Okay great. The content header you used, currently passes when used https:// – idk Feb 8 at 12:13
  • Funny how it shows one content-header when accessed using http and another when accessed using https, for the exact same xml file. example/sitemap.xml validates just fine. I have a property on GSC for example I have sent in the sitemap using the validated url on that property on GSC, and still get "Couldn't fetch". Frustrating. – niels Feb 8 at 13:44
  • Use "Visual SEO Studio" to generate a sitemap and then upload it. This will solve your problems as you seem to have problem with manually creating a sitemap. – idk Feb 9 at 5:30
  • Usually I have no problem creating sitemaps. Actually I prepared two different websites on the same day, creating sitemap and robots using the same editor, added properties in GSC for both websites in the same way, sent in the sitemaps only a few minutes apart. For the first websites is worked perfectly (as usual), but for the second on, the one in question, Google will not fetch the sitemap. was hoping someone had run into the same issue before, and had found a solution. – niels Feb 9 at 19:56

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.