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
2
Answers
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:
I think that only applies to the sitemap document itself.
When submitting the sitemap to google, I tried...
The only format that they were able to fetch the sitemap from was:
Hope this information might help someone else facing the same issue :)
put this tag in your robots.txt file
Sitemap: domainname.com/sitemap.xml
. Hope this will be helpful.