Skip to content

Why isn't my GitHub Pages site showing on Google?

New GitHub Pages sites often miss Google because they have no sitemap, no Search Console property, and few links. Here are the causes, in order.

By Bruno Amorim · ·

Why your GitHub Pages site isn't on Google

Check these in order. The first ones keep the whole site off Google. The last ones keep single pages off.

  1. The site is new. A new github.io site has almost no links from other sites, so Google may not know it exists yet. Search Google for site: followed by your domain, such as site:example.com. If nothing shows, Google likely has none of your pages yet. URL Inspection in Search Console gives the exact answer for each page.
  2. The site doesn't build, or its address changed. Pages needs an index.html, in lowercase, at the top of your publishing source. Changing a repository between public and private changes the site's address. If the home page returns 404, Google sees nothing.
  3. A noindex tag is in your layout. Check the <head> of your layout for <meta name="robots" content="noindex">, and remove it from pages you want found.
  4. Your robots.txt is in the wrong place. Google reads robots.txt only at the top of a host. On a project site at username.github.io/repo, Google reads username.github.io/robots.txt, not the one in your repository.
  5. There is no sitemap or Search Console property. Add jekyll-sitemap to the plugins list in _config.yml. GitHub Pages supports it, and it builds /sitemap.xml. Add a URL-prefix property for your site's address in Search Console, verify it with the HTML tag or file, and submit the sitemap.
  6. Pages say too little. A README turned into a one-page site gives Google little to show. Add pages that each answer one question in full.
  7. Few links point to the site. Add the site's address to the repository's About section and README, and link to it from your profile and other projects.

If only some pages are missing: the three most common reasons on GitHub Pages

Search Console shows the reason for each page in Indexing > Pages. These three come up most on GitHub Pages.

  1. Why it happens
    A new github.io site has few links from other sites, so Google waits before it visits.
    The fix
    Submit your sitemap in Search Console, and link to the site from the repository's README and About section.
  2. Why it happens
    Short pages made from a README or a few lines of Markdown give Google little to show.
    The fix
    Make each page answer one question in full, and link to it from your home page.
  3. Why it happens
    An Index.html with a capital letter, a moved repository, or a custom domain change without a new build breaks addresses.
    The fix
    Name the entry file index.html, push a commit to rebuild after domain changes, and add a 404.html page for addresses that are really gone.

Where your sitemap is

GitHub Pages doesn't make a sitemap by default. With Jekyll, add jekyll-sitemap to the plugins list in _config.yml, and it builds /sitemap.xml. With another site generator, build the sitemap in your workflow.

Questions

Can a GitHub Pages project site get on Google?

Yes. Google indexes username.github.io/repo pages like any other site. Add a URL-prefix property for that address in Search Console, because you can't verify a Domain property for github.io.

Do I need a custom domain for Google?

No. A custom domain lets you verify a Domain property in Search Console. When your DNS records are right, GitHub Pages redirects between the www and bare versions for you.

Sources

Which of your GitHub Pages pages does Google skip?

Sign in with Google. CrawlCoach checks up to 500 pages for free and shows the fix for each problem.

Get my free report

Free for up to 500 pages. No card needed. Sign in with the Google account you use for Search Console.

Other platforms