13

Google Search Console can't fetch sitemap on GitHub Pages

 2 years ago
source link: https://dev.to/stankukucka/google-search-console-cant-fetch-sitemap-on-github-pages-31kn
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Cover image for Google Search Console can't fetch sitemap on GitHub Pages
Stan ku2ck4

Posted on Nov 1

• Updated on Nov 2

Google Search Console can't fetch sitemap on GitHub Pages

You decided to build your website and you did the decision to publish your tweaked website to GitHub pages. That's cool hosting for your static website to choose from.

You do want to now see this page and other related pages indexed in Google as soon as possible. So you verified your page with Google Search Console with one of the options it offers. It is uploading an HTML file to your GitHub account right next to other website files or adding a meta tag to your site's homepage.

That's great. But what if you would like to fetch the website's sitemap XML file and it won't work for you as good as you want this way?

Google search console won't fetch your sitemap XML

There has been notified some indexation delays regards to Google index speed to process new pages on its own. To beat this issue, the best way is to submit sitemap XML into Google Search Console to let know google bot about your website's structure - pages your website has. But what if after adding sitemap XML file it shows up in the submitted sitemaps section "Couldn't fetch" info?

There is no need to upload to GitHub pages file called .nojekyll as some advice has been found pointing out to this practice.

Create robots.txt file on Github Pages

To let know Google bot about your sitemap just simple create on a root level of GitHub pages file named robots.txt and write there this information.

First is about where your sitemap XML file is located and the rest of the information sayin' that your website si crawlable by any other crawlers (bots) in other words it's not blocking some specific bots from accessing content provided on a sitemap XML file as well.

Sitemap: https://your-website-url.github.io/sitemap.xml

User-agent: *
Disallow:
Enter fullscreen modeExit fullscreen mode

After you created this robots.txt file you can add a new sitemap into Google Search Console again and after apx. 12 hours will be fetched for sure.

Another way around is submitting a sitemap XML file the way to enter the whole URL string of your website with sitemap XML file at the end of https://www.google.com/ping?sitemap= like this hereunter.

https://www.google.com/ping?sitemap=<complete_url_of_sitemap>
Enter fullscreen modeExit fullscreen mode

For example:

https://www.google.com/ping?sitemap=https://your-website-url.github.io/sitemap.xml
Enter fullscreen modeExit fullscreen mode

Then enter this into your browser where you'll be notified about it as follows "Sitemap Notification Received". This will tell to Google bot to ping your sitemap XML URL and to process it.

And that's it, whole magic is at the very end of this article. Next morning your sitemap XML file will be fetched as needed.

Thanks to Richy Great for the cover image from Unsplash.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK