{"id":185,"date":"2026-07-30T03:05:48","date_gmt":"2026-07-30T03:05:48","guid":{"rendered":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/"},"modified":"2026-11-30T03:20:10","modified_gmt":"2026-11-30T03:20:10","slug":"robots-txt-explained-kenya","status":"publish","type":"post","link":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/","title":{"rendered":"Robots.txt Explained: Controlling How Google Crawls Your Kenyan Website"},"content":{"rendered":"<p>Here&#8217;s a scenario that happens more often than you&#8217;d think: a Kenyan business owner spends months building a website, launches it, waits for traffic, and nothing shows up on Google \u2014 not even a search for the exact business name. Nine times out of ten when this happens, the culprit is a tiny, easy-to-overlook file called robots.txt.<\/p>\n<p>It&#8217;s a plain text file sitting at the root of your domain \u2014 something like buydomainkenya.co.ke\/robots.txt \u2014 and it gives instructions to search engine crawlers (Google, Bing, and others) about which parts of your site they&#8217;re allowed to visit and index. Get it wrong, and you can accidentally tell Google to ignore your entire website.<\/p>\n<h2>What robots.txt actually does<\/h2>\n<p>When Googlebot arrives at your website, the very first thing it checks is the robots.txt file. It&#8217;s essentially a set of rules that says &#8220;you can look here&#8221; or &#8220;please don&#8217;t look there.&#8221; A simple example looks like this:<\/p>\n<pre>User-agent: *\nDisallow: \/wp-admin\/\nAllow: \/wp-admin\/admin-ajax.php<\/pre>\n<p>This tells all crawlers (&#8220;User-agent: *&#8221;) to stay out of the WordPress admin area, except for one specific file needed for the site to function properly. That&#8217;s a healthy, normal setup.<\/p>\n<h2>The mistake that kills your Google traffic<\/h2>\n<p>The dangerous version looks like this:<\/p>\n<pre>User-agent: *\nDisallow: \/<\/pre>\n<p>That single forward slash after &#8220;Disallow:&#8221; tells every search engine to stay away from your entire site \u2014 every page, every product, every blog post. This often happens by accident during website development: a developer sets this rule while building the site on a staging server (so Google doesn&#8217;t index an unfinished site), and then forgets to remove it when the site goes live.<\/p>\n<p>If you&#8217;ve launched a website and it&#8217;s simply not appearing anywhere on Google after a few weeks, checking your robots.txt file should be one of your first steps. Just type yourwebsite.co.ke\/robots.txt into your browser and see what comes up.<\/p>\n<h2>What you should typically allow and block<\/h2>\n<p>For most Kenyan business websites running WordPress, the goal is simple: let Google see your actual content \u2014 homepage, blog posts, product pages, service pages \u2014 and keep it away from backend and duplicate content areas.<\/p>\n<ul>\n<li><strong>Block:<\/strong> \/wp-admin\/, internal search result pages, staging or test subdomains, thank-you pages after checkout<\/li>\n<li><strong>Allow:<\/strong> your homepage, blog, product and service pages, images you want to appear in Google Images<\/li>\n<\/ul>\n<p>You generally do not need to block your CSS or JavaScript files anymore \u2014 modern Google needs to load these to understand how your page looks and functions, and blocking them can actually hurt your search rankings.<\/p>\n<h2>Add your sitemap to the file<\/h2>\n<p>A well-built robots.txt file usually ends with a line pointing to your XML sitemap, which helps search engines discover all your pages faster:<\/p>\n<pre>Sitemap: https:\/\/yourwebsite.co.ke\/sitemap.xml<\/pre>\n<p>If you&#8217;re using an SEO plugin like Yoast or Rank Math on WordPress, this sitemap is usually generated automatically \u2014 you just need to make sure the line is included in robots.txt.<\/p>\n<h2>How to check and edit yours<\/h2>\n<p>If your site runs on WordPress with an SEO plugin installed, you can usually edit robots.txt directly from the plugin&#8217;s settings without touching any code \u2014 Yoast SEO, for example, has a robots.txt editor under Tools. If you manage the site through cPanel, you can also edit the file directly via the File Manager, in the public_html folder.<\/p>\n<p>After making changes, use Google Search Console&#8217;s robots.txt tester (under the old version, or the URL Inspection tool in the newer version) to confirm your important pages are marked as allowed, not blocked.<\/p>\n<h3>A quick gut check<\/h3>\n<ol>\n<li>Visit yourdomain.co.ke\/robots.txt in your browser<\/li>\n<li>Confirm there&#8217;s no blanket &#8220;Disallow: \/&#8221; blocking your whole site<\/li>\n<li>Confirm your sitemap URL is listed<\/li>\n<li>Confirm sensitive areas like \/wp-admin\/ are blocked<\/li>\n<\/ol>\n<p>It takes five minutes to check, and catching a misconfigured robots.txt file early can save you months of invisible-to-Google frustration. If you&#8217;re setting up a new site and want a hosting environment where these SEO fundamentals are easy to manage from day one, <a href=\"https:\/\/www.buydomainkenya.co.ke\/hosting\">have a look at our WordPress-ready hosting plans<\/a>.<\/p>\n<h2>A word of caution before you edit it yourself<\/h2>\n<p>Robots.txt is a small file, but it carries real weight \u2014 a single misplaced character can undo months of SEO work. If you&#8217;re not confident editing it directly, most SEO plugins offer a guided editor that reduces the risk of typos. And after any change, always re-check the live file in your browser rather than trusting that the save button worked as expected. It&#8217;s a two-minute habit that can save you weeks of wondering why your traffic suddenly dropped.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A misconfigured robots.txt file can accidentally hide your entire website from Google. Here&#8217;s what the file does and how to set it up correctly.<\/p>\n","protected":false},"author":1,"featured_media":1049,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-185","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to-guides"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Robots.txt Explained: Control How Google Crawls Your Site<\/title>\n<meta name=\"description\" content=\"Robots.txt explained: what to allow and block, common mistakes that hide pages from Google, and how to test your file.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Robots.txt Explained: Control How Google Crawls Your Site\" \/>\n<meta property=\"og:description\" content=\"Robots.txt explained: what to allow and block, common mistakes that hide pages from Google, and how to test your file.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/\" \/>\n<meta property=\"og:site_name\" content=\"Buy Domain Kenya Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-30T03:05:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-30T03:20:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/buydomainkenya.co.ke\/blog\/wp-content\/uploads\/2026\/07\/robots-txt-kenya.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/#\\\/schema\\\/person\\\/a0a4397f72e0ba4bf433dfb2cde1f9f0\"},\"headline\":\"Robots.txt Explained: Controlling How Google Crawls Your Kenyan Website\",\"datePublished\":\"2026-07-30T03:05:48+00:00\",\"dateModified\":\"2026-11-30T03:20:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/\"},\"wordCount\":780,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/robots-txt-kenya.jpg\",\"articleSection\":[\"How-To Guides\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/\",\"url\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/\",\"name\":\"Robots.txt Explained: Control How Google Crawls Your Site\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/robots-txt-kenya.jpg\",\"datePublished\":\"2026-07-30T03:05:48+00:00\",\"dateModified\":\"2026-11-30T03:20:10+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/#\\\/schema\\\/person\\\/a0a4397f72e0ba4bf433dfb2cde1f9f0\"},\"description\":\"Robots.txt explained: what to allow and block, common mistakes that hide pages from Google, and how to test your file.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/#primaryimage\",\"url\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/robots-txt-kenya.jpg\",\"contentUrl\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/robots-txt-kenya.jpg\",\"width\":1280,\"height\":960,\"caption\":\"Robots.txt \u2013 technology event in Sandton, Johannesburg, South Africa\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/robots-txt-explained-kenya\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Robots.txt Explained: Controlling How Google Crawls Your Kenyan Website\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/\",\"name\":\"Buy Domain Kenya Blog\",\"description\":\"Domain Registration &amp; Web Hosting Tips for Kenyan Businesses\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/#\\\/schema\\\/person\\\/a0a4397f72e0ba4bf433dfb2cde1f9f0\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/24b7e165fd57790001c625b5bad05592a560f2847fc53d1815a391874de505cf?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/24b7e165fd57790001c625b5bad05592a560f2847fc53d1815a391874de505cf?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/24b7e165fd57790001c625b5bad05592a560f2847fc53d1815a391874de505cf?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\"],\"url\":\"https:\\\/\\\/buydomainkenya.co.ke\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Robots.txt Explained: Control How Google Crawls Your Site","description":"Robots.txt explained: what to allow and block, common mistakes that hide pages from Google, and how to test your file.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/","og_locale":"en_US","og_type":"article","og_title":"Robots.txt Explained: Control How Google Crawls Your Site","og_description":"Robots.txt explained: what to allow and block, common mistakes that hide pages from Google, and how to test your file.","og_url":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/","og_site_name":"Buy Domain Kenya Blog","article_published_time":"2026-07-30T03:05:48+00:00","article_modified_time":"2026-11-30T03:20:10+00:00","og_image":[{"width":1280,"height":960,"url":"https:\/\/buydomainkenya.co.ke\/blog\/wp-content\/uploads\/2026\/07\/robots-txt-kenya.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/#article","isPartOf":{"@id":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/"},"author":{"name":"admin","@id":"https:\/\/buydomainkenya.co.ke\/blog\/#\/schema\/person\/a0a4397f72e0ba4bf433dfb2cde1f9f0"},"headline":"Robots.txt Explained: Controlling How Google Crawls Your Kenyan Website","datePublished":"2026-07-30T03:05:48+00:00","dateModified":"2026-11-30T03:20:10+00:00","mainEntityOfPage":{"@id":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/"},"wordCount":780,"commentCount":0,"image":{"@id":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/#primaryimage"},"thumbnailUrl":"https:\/\/buydomainkenya.co.ke\/blog\/wp-content\/uploads\/2026\/07\/robots-txt-kenya.jpg","articleSection":["How-To Guides"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/","url":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/","name":"Robots.txt Explained: Control How Google Crawls Your Site","isPartOf":{"@id":"https:\/\/buydomainkenya.co.ke\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/#primaryimage"},"image":{"@id":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/#primaryimage"},"thumbnailUrl":"https:\/\/buydomainkenya.co.ke\/blog\/wp-content\/uploads\/2026\/07\/robots-txt-kenya.jpg","datePublished":"2026-07-30T03:05:48+00:00","dateModified":"2026-11-30T03:20:10+00:00","author":{"@id":"https:\/\/buydomainkenya.co.ke\/blog\/#\/schema\/person\/a0a4397f72e0ba4bf433dfb2cde1f9f0"},"description":"Robots.txt explained: what to allow and block, common mistakes that hide pages from Google, and how to test your file.","breadcrumb":{"@id":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/#primaryimage","url":"https:\/\/buydomainkenya.co.ke\/blog\/wp-content\/uploads\/2026\/07\/robots-txt-kenya.jpg","contentUrl":"https:\/\/buydomainkenya.co.ke\/blog\/wp-content\/uploads\/2026\/07\/robots-txt-kenya.jpg","width":1280,"height":960,"caption":"Robots.txt \u2013 technology event in Sandton, Johannesburg, South Africa"},{"@type":"BreadcrumbList","@id":"https:\/\/buydomainkenya.co.ke\/blog\/robots-txt-explained-kenya\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/buydomainkenya.co.ke\/blog\/"},{"@type":"ListItem","position":2,"name":"Robots.txt Explained: Controlling How Google Crawls Your Kenyan Website"}]},{"@type":"WebSite","@id":"https:\/\/buydomainkenya.co.ke\/blog\/#website","url":"https:\/\/buydomainkenya.co.ke\/blog\/","name":"Buy Domain Kenya Blog","description":"Domain Registration &amp; Web Hosting Tips for Kenyan Businesses","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/buydomainkenya.co.ke\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/buydomainkenya.co.ke\/blog\/#\/schema\/person\/a0a4397f72e0ba4bf433dfb2cde1f9f0","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/24b7e165fd57790001c625b5bad05592a560f2847fc53d1815a391874de505cf?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/24b7e165fd57790001c625b5bad05592a560f2847fc53d1815a391874de505cf?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/24b7e165fd57790001c625b5bad05592a560f2847fc53d1815a391874de505cf?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/buydomainkenya.co.ke\/blog"],"url":"https:\/\/buydomainkenya.co.ke\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":1,"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"predecessor-version":[{"id":186,"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/posts\/185\/revisions\/186"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/media\/1049"}],"wp:attachment":[{"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buydomainkenya.co.ke\/blog\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}