- Blog
- SEO and GEO
robots.txt And Sitemap: Showing Search Engines The Way
robots.txt is a text file that tells search engine crawlers which parts of the site they may crawl. A sitemap is the list of addresses you want crawled. One says “Do not go in here,” the other says “Look at these.” Neither is, on its own, the way to hide a page or to get it indexed.
What Does robots.txt Do?
By Google’s account, this file is used primarily to manage crawler traffic. The file must sit in the root directory of the site; for example https://www.ornek.com/robots.txt. A file placed in a subfolder is not valid, and a site has only one.
A simple example:
User-agent: *
Disallow: /sepet/
Disallow: /arama/
Sitemap: https://www.ornek.com/sitemap.xml
User-agent: *states that the rule applies to all crawlers.Disallowshows the path you do not want crawled.- The
Sitemapline gives the full address of the sitemap.
As long as you do not write a rule, all addresses are considered open to crawling.
What Does robots.txt Not Do?
The most common mistake is to take this file for a privacy tool.
Google states it plainly: robots.txt is not a method for keeping a page out of Google. An address blocked from crawling can still be indexed if it gets links from other sites, and it can appear in the results without a description.
The file itself is also open to everyone. Writing Disallow: /gizli-teklifler/ means announcing that the folder exists. Whether to follow the rules is also left to the crawler; a malicious bot may ignore the file.
Private content such as customer data, a proposal file or an admin panel needs real access control: sign-in, a password or a server-side permission check.
How Does It Differ From noindex?
The two tools answer different questions:
| Tool | The Question It Answers |
|---|---|
robots.txt |
Should the crawler visit this address? |
noindex |
Should this page appear in search results? |
If you do not want a page to appear in the results, the way Google recommends is to use noindex or to protect the page with a password.
<!-- Added only to the page you do not want to appear in the results. -->
<meta name="robots" content="noindex">
There is a trap here: If you both block the same page with robots.txt and add noindex, the crawler cannot see the noindex directive because it cannot enter the page. The page you want removed from the results has to be open to crawling.
What Is A Sitemap?
A sitemap is a file that tells search engines about the pages on your site. Its most common format is XML:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.ornek.com/hizmetler/ofis-temizligi/</loc>
<lastmod>2026-11-20</lastmod>
</url>
</urlset>
A few points worth knowing from Google’s documentation:
- A single sitemap is limited to 50 MB or 50,000 addresses; larger sites split the file.
- Google ignores the
priorityandchangefreqvalues. - The
lastmodvalue is used if it is consistently and verifiably accurate. Pulling every date to today on each build damages this trust. - Submitting a sitemap does not mean that all the addresses in it will be crawled and indexed.
Google also notes that small sites with proper internal links may not need a sitemap. I still prefer to add one; most systems generate the file by themselves, and it makes it easier to follow the status in Search Console.
Put into the file only the pages that you want indexed, that open and that are the canonical address. Addresses that redirect, return an error or carry noindex should not be on the list.
How Do You Submit It To Search Console?
- Open the address of the sitemap in the browser and check that the file shows.
- Select your property in Search Console and open the Sitemaps report.
- Type the address into the “Add a new sitemap” field and submit it.
- Check the status column; if there is an error, click the row and look at the details.
Submitting requires owner permission on the property. If you do not have the permission, adding a Sitemap line to robots.txt is also a way of notifying.
Compare the number of “discovered pages” in the report with your own page count. A large difference may show that addresses are missing or that extra ones are being generated.
Frequently Asked Questions
If I Have No robots.txt File, Will My Site Not Be Crawled?
It will be crawled. If there is no file, crawlers consider all addresses open to crawling.
Can I Hide A Test Site With robots.txt?
It is not a secure method. I recommend protecting the test environment with a password.
Does A Sitemap Raise Rankings?
A sitemap helps addresses get found. It contains no promise about ranking.
Related Guides
You can continue the check with the technical SEO checklist and a small Python audit tool.