Marketing

Sitemap and robots.txt: configuring them correctly so Google can read your website

Illustration: Sitemap and robots.txt: configuring them correctly so Google can read your website
Photo: RosZie / Pixabay (Pixabay Content License)

Two small files at the root of a website, the sitemap and robots.txt, are often misconfigured, especially when a website has just changed hosting or been rebuilt. One mistaken blocking line can stop Google from reading the entire website. This article explains what each file does, how to submit a sitemap, and how to check.

What a sitemap does

A sitemap is a file listing the pages, images, or videos on a website, helping search engines discover content more efficiently. According to Google, a small website (a few hundred pages) with good internal linking may not need a sitemap. A sitemap is more useful when the website is large, new with few links pointing to it, or has many images and videos.

Some technical points per Google's documentation:

  • Google supports XML, RSS/Atom, and plain-text sitemaps; XML is the most flexible.
  • One file is limited to 50 MB uncompressed or 50,000 URLs; large websites should split into multiple files and combine them with a sitemap index file.
  • The file must be UTF-8 encoded and use full, absolute URLs.
  • A sitemap is only a hint and does not guarantee Google will crawl or index every URL in it.

Many content management systems such as WordPress already generate sitemaps automatically (via an SEO plugin or a built-in feature), so you only need to check rather than create one yourself.

Submitting a sitemap to Google

There are two common ways:

  1. Search Console: Go to the Sitemaps report, enter the sitemap file path, and submit. This page shows the file reading status and the number of URLs discovered.
  2. The `Sitemap:` line in robots.txt: Add a line in the form `Sitemap: https://tenmiencuaban.vn/sitemap.xml`.

Only include URLs in the sitemap that you want to appear and that return a normal status. Remove deleted pages, redirected pages, and duplicate pages.

Blocking the right things in robots.txt

robots.txt tells crawlers which URLs they may or may not access. According to Google, its main purpose is to manage crawl traffic, avoid overloading the server, and keep bots out of unimportant or duplicate pages.

The key point is that robots.txt is not a way to hide a page from Google. A blocked page can still appear in results if other websites link to it, usually without a description. To keep a page from appearing, use the `noindex` directive or password protection, and note that if a page is blocked in robots.txt, Google cannot read the `noindex` on that page. Also, not every bot follows robots.txt.

Things that usually make sense to block: admin pages, internal search results, shopping carts, and checkout pages. For example, for a simple online store as in the article online stores: cart, checkout, shipping, cart pages usually don't need to appear on Google.

Common blocking mistakes

  • Blocking the entire website: a `Disallow: /` line left over from the test website stage and then pushed to the live website. This often happens when changing hosting; see also moving hosting without losing rankings.
  • Blocking interface files: blocking folders containing CSS or JavaScript makes it hard for Google to understand the page. Google notes that blocking resources can affect how it understands the content.
  • Sitemap containing blocked pages: conflicting signals; review them so they match.
  • Wrong domain: the sitemap still points to the old domain or the http version after switching to https.

Quick checklist

  1. Open `yourdomain/robots.txt` and read it line by line.
  2. Open `yourdomain/sitemap.xml` (or the path you use) to check it opens and has the right domain.
  3. Submit the sitemap in Search Console and review the error report.
  4. Use the URL Inspection tool in Search Console for a few important pages.
  5. Recheck after every change of theme, plugin, or hosting.

Page speed and experience are also part of how Google evaluates sites; see Page Experience and Core Web Vitals. Your business profile on maps also needs information consistent with your website; see Google Business Profile: Registering, Verifying, and Updating. If you need support with technical SEO, you can contact HVSC's Marketing team via the page SEO service. Website design is at website design services.

2026 update: The basic principles of sitemaps and robots.txt have not changed much, but the details of the tools in Search Console may have changed their interface. Check official information at Google Search Central. For page performance, see also Core Web Vitals for Business Websites.

FAQ

Does a small website need a sitemap?

Google says a small website with good internal linking may not need one. Even so, submitting a sitemap still helps you monitor the reading status in Search Console.

Can robots.txt hide a page from Google?

No. Use `noindex` or a password if you want a page not to appear. robots.txt only manages crawling.

How long after editing robots.txt does Google update?

Google rereads the file on its own cycle with no fixed time. Recheck with Search Console after a few days.

Reference sources

Want customers to find you on Google and AI?

Send your existing website or channel, and HVSC will do a quick review and suggest what to do first.

FAQ

Does a small website need a sitemap?

Google says a small website with good internal linking may not need one. Even so, submitting a sitemap still helps you monitor the reading status in Search Console.

Can robots.txt hide a page from Google?

No. Use `noindex` or a password if you want a page not to appear. robots.txt only manages crawling.

How long after editing robots.txt does Google update?

Google rereads the file on its own cycle with no fixed time. Recheck with Search Console after a few days.

· Ban biên tập HVSCTổng hợp từ 3 nguồn chính thống, có dẫn nguồnHVSC - Phương Thảo thuộc Ban biên tập HVSC, phụ trách mảng marketing số, SEO và quảng cáo. Nội dung do HVSC chịu trách nhiệm.Bài khác của HVSC - Phương Thảo:Xem tất cả bài của HVSC - Phương Thảo →
Was this article helpful to you?Tap a star. Your feedback helps the editorial team write articles that better fit your needs.

📚 Related articles

See more in Marketing