SEO GitHub Pages
SEO GitHub Pages refers to the practices of optimizing static websites hosted on GitHub Pages for better visibility in search engines.

Key takeaways
- Use a custom domain and enable HTTPS for credibility and ranking.
- Always create and submit a sitemap.xml to Google.
- Configure robots.txt to guide crawlers and avoid waste.
- Optimize meta tags, headings, and permalinks for target keywords.
- Add structured data and monitor indexing via Google Search Console.
SEO GitHub Pages is the process of optimizing static websites hosted on GitHub Pages for search engines. Although GitHub Pages is a free hosting service, it requires specific technical SEO steps to ensure proper indexing and ranking. This guide covers the essential optimizations for a Jekyll-based or custom static site on GitHub Pages.
Prerequisites for SEO-Friendly GitHub Pages
Before diving into SEO, ensure your site is set up correctly. Use a custom domain (e.g., example.com) instead of the default <username>.github.io subdomain. A custom domain improves trust and allows you to control the full URL. Enable HTTPS – GitHub Pages automatically provisions SSL certificates for custom domains. For Jekyll sites, install the jekyll-sitemap gem and enable permalinks like /post-name/.
Technical SEO: Sitemap, Robots.txt, and Indexing
Every GitHub Pages site should have a sitemap.xml to list all important pages. For Jekyll, add gem 'jekyll-sitemap' to your Gemfile and configure it. Submit the sitemap to Google Search Console. Also create a robots.txt file to disallow crawl of unnecessary directories (e.g., /assets/) and point to the sitemap. Check that Google can access your site by using the URL Inspection tool in Search Console.
On-Page SEO: Content and Meta Tags
Optimize every page with a unique meta title and description. Ensure heading tags (H1, H2) are descriptive and contain target keywords. For Jekyll, use Front Matter defaults to set titles and descriptions. Use clean, keyword-rich permalinks (e.g., /blog/seo-tips). Write high-quality, original content; static pages load fast, which is a ranking advantage.
Performance and Structured Data
GitHub Pages sites are inherently fast, but optimize images and minify CSS/JS. Use Jekyll plugins like jekyll-seo-tag to add structured data (e.g., JSON-LD for articles). Add schema markup for articles, breadcrumbs, or organization to help search engines understand your content. Test structured data with Google's Rich Results Test.
Common Mistakes to Avoid
Avoid serving content over plain HTTP. Do not forget to add a sitemap – many GitHub Pages sites lack one. Ensure your site has a .nojekyll file if you are not using Jekyll (to avoid GitHub processing). Verify that your custom domain points correctly via CNAME or A records. Do not block CSS/JS files in robots.txt, as that can harm rendering.
FAQ
Can GitHub Pages rank on Google?
Yes, as long as you follow standard SEO practices. Static sites are fast, which is a positive ranking factor.
Do I need a custom domain for SEO on GitHub Pages?
Strongly recommended. A custom domain increases authority and avoids issues related to the shared subdomain.
How do I create a sitemap for GitHub Pages?
For Jekyll, use the jekyll-sitemap plugin. For other static sites, generate a sitemap manually and place it at /sitemap.xml.
Related topics
Reviewed by Lucía Marín, Founding editor.