<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ujjwal Nitai Das</title>
    <description>The latest articles on DEV Community by Ujjwal Nitai Das (@ujjwal-nitai-das).</description>
    <link>https://dev.to/ujjwal-nitai-das</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4137560%2F126dc18b-d95e-45ec-b7cc-543978e253cc.png</url>
      <title>DEV Community: Ujjwal Nitai Das</title>
      <link>https://dev.to/ujjwal-nitai-das</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ujjwal-nitai-das"/>
    <language>en</language>
    <item>
      <title>How to Create and Optimize robots.txt for Better SEO (2026 Guide)</title>
      <dc:creator>Ujjwal Nitai Das</dc:creator>
      <pubDate>Tue, 22 Sep 2026 12:12:01 +0000</pubDate>
      <link>https://dev.to/ujjwal-nitai-das/how-to-create-and-optimize-robotstxt-for-better-seo-2026-guide-21i4</link>
      <guid>https://dev.to/ujjwal-nitai-das/how-to-create-and-optimize-robotstxt-for-better-seo-2026-guide-21i4</guid>
      <description>&lt;p&gt;A few years back I spent an entire afternoon debugging why a client's blog had stopped showing up in Google, only to find someone had left a stray line in their robots.txt file that blocked the whole site. It took thirty seconds to fix and about a week for the traffic to recover. That's the thing about robots.txt: it's one of the smallest files on your server, but it can quietly do a lot of damage if you're not paying attention to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is robots.txt, Really?
&lt;/h2&gt;

&lt;p&gt;It's just a plain text file sitting at the root of your domain, something like &lt;code&gt;https://yoursite.com/robots.txt&lt;/code&gt;. When a search engine bot shows up to crawl your site, it checks this file first and follows whatever instructions it finds there, assuming it's a bot that plays by the rules (most of the big ones do).&lt;/p&gt;

&lt;p&gt;Here's roughly what one looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;User&lt;/span&gt;-&lt;span class="n"&gt;agent&lt;/span&gt;: *
&lt;span class="n"&gt;Disallow&lt;/span&gt;: /&lt;span class="n"&gt;admin&lt;/span&gt;
&lt;span class="n"&gt;Disallow&lt;/span&gt;: /&lt;span class="n"&gt;search&lt;/span&gt;
&lt;span class="n"&gt;Allow&lt;/span&gt;: /

&lt;span class="n"&gt;Sitemap&lt;/span&gt;: &lt;span class="n"&gt;https&lt;/span&gt;://&lt;span class="n"&gt;yoursite&lt;/span&gt;.&lt;span class="n"&gt;com&lt;/span&gt;/&lt;span class="n"&gt;sitemap&lt;/span&gt;.&lt;span class="n"&gt;xml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not much to it. &lt;code&gt;User-agent&lt;/code&gt; tells you which bot the rule is for (the asterisk just means "all of them"). &lt;code&gt;Disallow&lt;/code&gt; marks off paths you don't want crawled. &lt;code&gt;Allow&lt;/code&gt; carves out an exception inside a folder you've otherwise blocked. And &lt;code&gt;Sitemap&lt;/code&gt; just points the crawler toward your sitemap so it can find your content faster instead of stumbling around.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where People Actually Use This
&lt;/h2&gt;

&lt;p&gt;In practice, most robots.txt files exist to solve a handful of recurring problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keeping crawlers out of admin panels, internal APIs, or staging environments that have no business being indexed&lt;/li&gt;
&lt;li&gt;Stopping duplicate content from piling up in search results (think search pages, filtered URLs, or tag archives that repeat your main content)&lt;/li&gt;
&lt;li&gt;Protecting crawl budget on bigger sites so bots spend their time on pages that matter instead of endless low-value URLs&lt;/li&gt;
&lt;li&gt;Pulling a single old post out of the index without touching everything around it, like:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;Disallow&lt;/span&gt;: /&lt;span class="m"&gt;2016&lt;/span&gt;/&lt;span class="m"&gt;03&lt;/span&gt;/&lt;span class="n"&gt;old&lt;/span&gt;-&lt;span class="n"&gt;post&lt;/span&gt;.&lt;span class="n"&gt;html&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That last one comes in handy more often than you'd think, especially if you're cleaning up an old blog with years of posts nobody needs anymore.&lt;/p&gt;

&lt;h2&gt;
  
  
  Crawl Budget Isn't Just a Buzzword
&lt;/h2&gt;

&lt;p&gt;Search engines don't crawl every page on your site every time, and they definitely don't crawl it infinitely. Each site gets something like a budget, shaped by things like how authoritative it is and how fast your server responds. If you're running a small personal blog, honestly, none of this matters much. But once you're dealing with a large site (an online store with thousands of product pages, a forum, a big content archive) crawlers can waste a surprising amount of time on junk URLs from filters or search parameters. Cleaning that up in robots.txt is a cheap way to get your important pages noticed faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  What It Won't Do for You
&lt;/h2&gt;

&lt;p&gt;Here's a mistake I still see people make: trying to use robots.txt to hide something private. It just doesn't work that way. The file itself is public, anyone can open it in a browser, and a page you've blocked can still end up indexed (without a snippet, but indexed) if something else on the web links to it. If you actually need a page kept out of search results, use a noindex tag or the X-Robots-Tag header instead. robots.txt is for managing crawl traffic, not for security.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before You Push It Live
&lt;/h2&gt;

&lt;p&gt;A one-character typo here can tank your whole site's visibility, so it's worth double-checking before you save:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;code&gt;yoursite.com/robots.txt&lt;/code&gt; in a browser and make sure it's actually loading correctly&lt;/li&gt;
&lt;li&gt;Run it through Google Search Console's robots.txt tester so any syntax mistakes get caught early&lt;/li&gt;
&lt;li&gt;Scan for a stray &lt;code&gt;Disallow: /&lt;/code&gt; sitting by itself, since that one line blocks literally everything&lt;/li&gt;
&lt;li&gt;If there's a CDN or proxy in front of your site, confirm it isn't still serving an old cached copy&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  If You're on Blogger or WordPress
&lt;/h2&gt;

&lt;p&gt;Hosted platforms usually don't let you upload the file directly, so you end up editing it through a settings panel instead. On Blogger it's under Settings &amp;gt; Search Preferences &amp;gt; Crawlers and Indexing &amp;gt; Custom robots.txt. WordPress.com has something similar, and a self-hosted WordPress site will generate a basic one automatically unless you replace it with your own. The rules themselves don't change, just how you get them onto the server.&lt;/p&gt;

&lt;p&gt;If you're managing this kind of setup for clients who aren't technical, especially on Blogger or WordPress, &lt;a href="https://utssites.com/" rel="noopener noreferrer"&gt;UTS Sites&lt;/a&gt; has put together some walkthroughs on this exact stuff, along with WordPress migrations and general site configuration, that are genuinely useful references.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Short Version
&lt;/h2&gt;

&lt;p&gt;robots.txt looks trivial, and honestly the syntax is simple enough that it is. The mistakes come from treating it as more than it's meant to be. Use it to guide crawlers, not to hide things, test every change before it goes live, and keep your sitemap linked in there. It's a small file, but getting it right is one of the easier wins you'll find in SEO.&lt;/p&gt;




&lt;p&gt;Ever had a robots.txt mistake blow up on you? I'd genuinely like to hear the story in the comments.&lt;/p&gt;

</description>
      <category>seo</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
