On this page
Two small files control whether Google finds your Kenyan business website efficiently: robots.txt and your XML sitemap. Get them wrong and you can launch a beautiful site that stays invisible for months. This guide explains both for Kenya SMEs — what to include, mistakes that block indexing, and how to submit sitemaps in Google Search Console.
Run our free SEO audit to confirm crawlers can reach your pages. For GSC submission steps, read Google Search Console guide for Kenyan businesses.
What is robots.txt and why does your Kenya website need one?
robots.txt lives at https://yourdomain.co.ke/robots.txt. It tells search engine bots (Googlebot, Bingbot) which URL paths they should not crawl. It is a politeness protocol — malicious bots ignore it, but Google respects it.
Every Kenyan business site should have an intentional robots.txt because:
- Default hosting templates sometimes ship with overly aggressive Disallow rules
- Staging sites get copied to production with
Disallow: /still active - You may want to block admin, cart, and search filter URLs from wasting crawl budget
robots.txt does not remove pages from Google's index by itself — for that you use noindex meta tags or authentication. But blocking crawl prevents Google from seeing updated content and meta tags.
What should a robots.txt file include for a Kenyan business website?
A typical SME brochure site on WordPress or Next.js:
User-agent: *
Allow: /
Disallow: /admin/
Disallow: /api/
Disallow: /dashboard/
Disallow: /wp-admin/
Disallow: /cart/
Disallow: /checkout/
Disallow: /*?*sessionid=
Sitemap: https://yourdomain.co.ke/sitemap.xml
Key principles:
- Allow / explicitly on production — clarity over defaults
- Disallow only paths with no SEO value — admin, internal tools, duplicate filters
- Always declare Sitemap URL with full HTTPS absolute path
- Do not block CSS, JS, or image folders Google needs to render mobile pages
Kenya ecommerce on WooCommerce: block /cart, /my-account, and faceted search parameters (?filter_price=) that create infinite URL variants.
What are common robots.txt mistakes that block Google in Kenya?
These appear repeatedly in Nairobi agency handoffs:
| Mistake | Impact |
|---|---|
Disallow: / on production | Site effectively uncrawlable |
Blocking /wp-content/ or /static/ | Google cannot render pages properly |
| Staging domain left noindex + production forgotten | Launch day panic |
Disallow on /blog/ "to hide drafts" | Entire content hub invisible |
| Missing sitemap line | Slower discovery of new URLs |
| Conflicting rules for Googlebot vs * | Unpredictable crawl |
Test after every deploy: visit /robots.txt in browser and use GSC URL Inspection → robots.txt section on your homepage.
One Karen retail client copied a developer's personal portfolio robots file that blocked /services/ — three months of ads to a page Google never refreshed.
What is an XML sitemap and how does Google use it?
An XML sitemap is a machine-readable list of URLs you consider important, optionally with lastmod dates and priority hints. Google uses it to discover and recrawl — not as a ranking boost.
Sitemaps help Kenyan sites when:
- New blog posts publish weekly
- You add location pages for Westlands, Kilimani, Mombasa Road
- Ecommerce inventory turns over frequently
- Internal linking is weak and orphan pages exist
Google still chooses whether to index each URL. A sitemap ensures Google knows the URL exists quickly — critical when competing for timely queries like school intake or holiday packages.
How do you create and submit a sitemap for a Kenya website?
Creation:
- Next.js / headless — auto-generated via
sitemap.tsat/sitemap.xml - WordPress — Yoast, Rank Math, or SEOPress generate
/sitemap_index.xml - Shopify —
/sitemap.xmlbuilt-in - Manual — only for static microsites under 20 URLs
Validate at /sitemap.xml — should return XML, not 404 HTML.
Submission:
- Verify site in Google Search Console (see GSC guide)
- Indexing → Sitemaps → Add new sitemap
- Enter
sitemap.xmlorsitemap_index.xml - Confirm processed URL count matches expectations
Also add sitemap URL to robots.txt Sitemap directive for Bing and other engines.
How do robots.txt and sitemap work together?
Think of robots.txt as the gate and sitemap as the guest list:
| File | Role |
|---|---|
| robots.txt | Tells crawlers where they may go |
| sitemap | Tells Google which URLs you prioritise |
Critical rule: never list URLs in sitemap that robots.txt blocks — conflicting signals waste crawl budget and confuse Search Console.
Healthy pattern for a Nairobi consultancy:
- robots.txt allows
/,/blog/,/services/ - robots.txt disallows
/dashboard/,/api/ - sitemap includes homepage, five service pages, ten blog posts, three location pages
- noindex only on thank-you and login pages — not via robots Disallow alone
When you noindex a page, remove it from sitemap too.
How often should you update robots.txt and your sitemap?
| Event | Action |
|---|---|
| New site section launch | Confirm sitemap auto-includes URLs |
| Staging → production cutover | Rewrite robots.txt — remove Disallow: / |
| Platform migration | Resubmit sitemap, monitor GSC Pages 2 weeks |
| Adding ecommerce filters | Disallow parameter URLs, trim sitemap bloat |
| Quarterly SEO review | Re-read robots.txt — plugins add rules silently |
Most modern stacks regenerate sitemaps on build — verify after each Vercel deploy if you ship content frequently.
Pair mechanical fixes with our free audit: robots and sitemap solve discovery; speed and content solve ranking.
After submission, watch Search Console for two weeks. If "Discovered – currently not indexed" counts stay high while sitemap shows Success, the problem is usually content quality or internal links — not the sitemap file itself.
robots.txt and sitemap are five-minute tasks that prevent five-month visibility gaps. Kenyan businesses competing on Safaricom mobile cannot afford Google missing half the site because someone copied the wrong text file at launch. Check both today — then submit in Search Console and move on to content that actually converts.
Ready to get your Kenya business found on Google?
Start with a free website audit — PageSpeed, SEO gaps, and quick wins.