Ad

Google Couldn't Fetch My Sitemap.xml File

- 1 answer

I've got a small flask site for my old wow guild and I have been unsuccessful in getting google to read my sitemap.xml file. I was able to successful verify my site using googles Search Console and it seems to crawl it just fine but when I go to submit my sitemap, it lists the status as "Couldn't fetch". When I click on that for more info all it says is "Sitemap could not be read" (not helpful)

I originally used a sitemap generator website (forgot which one) to create the file and then added it to my route file like this:

@main.route('/sitemap.xml')

def static_from_root():

    return send_from_directory(app.static_folder, request.path[1:])

If I navigated to www.mysite.us/sitemap.xml it would display the expected results but google was unable to fetch it.

I then changed things around and started using flask-sitemap to generate it like this:

@ext.register_generator

def index():

    yield 'main.index', {}

This also works fine when I navigate directly to the file but google again does not like this.

I'm at a loss. There doesn't seem to but any way to get help from google on this and so far my interweb searches aren't turning up anything helpful.

For reference, here is the current sitemap link: www.renewedhope.us/sitemap.xml

Ad

Answer

I finally got it figured out. This seems to go against what google was advising but I submitted the sitemap as http://renewedhope.us/sitemap.xml and that finally worked.

From their documentation:

Use consistent, fully-qualified URLs. Google will crawl your URLs exactly as listed. For instance, if your site is at https://www.example.com/, don't specify a URL as https://example.com/ (missing www) or ./mypage.html (a relative URL).

I think that only applies to the sitemap document itself.

When submitting the sitemap to google, I tried...

http://www.renewedhope.us/sitemap.xml  
https://www.renewedhope.us/sitemap.xml   
https://renewedhope.us/sitemap.xml   

The only format that they were able to fetch the sitemap from was:

http://renewedhope.us/sitemap.xml

Hope this information might help someone else facing the same issue :)

Ad
source: stackoverflow.com
Ad