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.
- The site is new. A new
github.iosite has almost no links from other sites, so Google may not know it exists yet. Search Google forsite:followed by your domain, such assite: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. - 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 returns404, Google sees nothing. - A
noindextag is in your layout. Check the<head>of your layout for<meta name="robots" content="noindex">, and remove it from pages you want found. - Your
robots.txtis in the wrong place. Google readsrobots.txtonly at the top of a host. On a project site atusername.github.io/repo, Google readsusername.github.io/robots.txt, not the one in your repository. - There is no sitemap or Search Console property. Add
jekyll-sitemapto thepluginslist 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. - 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.
- 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.
- Why it happens
- A new
github.iosite 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.
- 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.
- Why it happens
- An
Index.htmlwith 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 a404.htmlpage 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
- GitHub Docs: About GitHub Pages
- GitHub Docs: About GitHub Pages and Jekyll
- GitHub Pages: Dependency versions
- GitHub Docs: Troubleshooting 404 errors for GitHub Pages sites
- GitHub Docs: About custom domains and GitHub Pages
- Google Search Central: How Google interprets robots.txt
- Search Console Help: Add a website property
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 reportFree for up to 500 pages. No card needed. Sign in with the Google account you use for Search Console.