Skip to content
Keywords Everywhere
Technical SEO

Technical SEO Basics: Robots.txt, Sitemaps & Status Codes | Keywords Everywhere

Robots.txt rules, XML sitemaps, HTTP status codes, redirects, canonicals and noindex explained in plain English — with free tools to check each.

By Keywords Everywhere Team9 min read · 2,119 words
Technical SEO Basics: Robots.txt, Sitemaps & Status Codes

Technical SEO is everything that helps search engines find, crawl, understand and index your website. You can write the best content on the internet, but if a crawler cannot reach it, misreads it or decides not to index it, it will never rank.

The good news is that most technical problems on small and medium websites come from a handful of basics: the robots.txt file, XML sitemaps, HTTP status codes, redirects, canonical tags and indexing directives. This guide explains each one in plain language and shows you how to check them with free tools.

How search engines process a website

Before fixing anything, it helps to understand the three stages every page goes through.

1. Crawling

A search engine's crawler (Googlebot, Bingbot and others) discovers URLs by following links and reading sitemaps. It requests each URL and downloads the content.

2. Indexing

The search engine analyses the page — its text, headings, links, images and structured data — and decides whether to store it in its index. Pages can be excluded because of directives such as noindex, because they duplicate other pages, or because they are considered low quality.

3. Ranking

When someone searches, the engine chooses the most relevant and useful indexed pages to show.

Technical SEO mainly affects the first two stages. If crawling or indexing fails, ranking never happens.

Robots.txt: telling crawlers where to go

The robots.txt file lives at the root of your domain (for example, https://example.com/robots.txt). It tells crawlers which paths they may or may not request.

Basic structure

A robots.txt file is made of groups. Each group starts with one or more User-agent lines, followed by Allow and Disallow rules:

User-agent: *
Disallow: /admin/
Disallow: /cart/
Allow: /admin/help/

Sitemap: https://example.com/sitemap.xml
  • User-agent: * applies to all crawlers.
  • Disallow: /admin/ blocks every URL that starts with /admin/.
  • Allow: /admin/help/ re-opens a sub-folder inside a blocked folder.
  • Sitemap: tells crawlers where your XML sitemap is.

How rules are matched

For Google, the most specific matching rule wins — the rule with the longest path. If an Allow and a Disallow rule are equally specific, Allow wins. Wildcards are supported:

  • * matches any sequence of characters: Disallow: /*?sort= blocks sorted URLs.
  • $ marks the end of a URL: Disallow: /*.pdf$ blocks PDF files.

If a crawler has its own group (for example, User-agent: Googlebot), it follows that group only and ignores the * group.

What to block — and what not to

Usually safe to block:

  • Admin and login areas
  • Cart, checkout and account pages
  • Internal search result pages
  • Endless filter and sort parameter combinations

Never block:

  • Pages you want to rank
  • CSS and JavaScript files needed to render pages
  • Your sitemap

A crucial misunderstanding

Robots.txt controls crawling, not indexing. A blocked URL can still appear in search results (usually without a description) if other pages link to it. To keep a page out of results, allow crawling and add a noindex directive instead.

Test your rules

Use the robots.txt tester to fetch any site's robots.txt and check whether a specific path is allowed or blocked for Googlebot, Bingbot or any other user-agent. You can also paste a draft file to test changes before publishing them.

XML sitemaps: a map of your important pages

An XML sitemap is a file listing the URLs you want search engines to discover and index. It does not guarantee indexing, but it helps crawlers find pages — especially new pages and pages with few internal links.

What a sitemap looks like

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2026-08-04</lastmod>
  </url>
  <url>
    <loc>https://example.com/guides/keyword-research/</loc>
    <lastmod>2026-08-01</lastmod>
  </url>
</urlset>

Sitemap rules and best practices

  • Absolute URLs only. Every <loc> must be a full URL including https://.
  • Same host. URLs should belong to the domain where the sitemap is hosted.
  • Size limits. A single sitemap can contain up to 50,000 URLs and be up to 50 MB uncompressed. Larger sites use a sitemap index that lists several sitemaps.
  • Only canonical, indexable URLs. Do not include redirects, error pages, noindexed pages or duplicate URLs.
  • Accurate lastmod dates. Use the W3C date format (YYYY-MM-DD) and update it only when content meaningfully changes.
  • Optional fields. changefreq and priority are allowed but largely ignored by Google. If you use them, keep values valid.

Submitting your sitemap

  1. Add a Sitemap: line to your robots.txt.
  2. Submit the sitemap URL in Google Search Console and Bing Webmaster Tools.
  3. Check the reports for errors and for how many submitted URLs are indexed.

Validate it

The XML sitemap validator checks the namespace, URL count, file size, lastmod format, duplicates and cross-host URLs, and shows a sample of the entries it found.

HTTP status codes: what your server tells crawlers

Every time a browser or crawler requests a URL, the server responds with a three-digit status code. These codes matter for SEO because they tell search engines whether a page exists, has moved or has failed.

2xx: success

  • 200 OK — the page loaded normally. This is what you want for every page you intend to rank.

3xx: redirects

  • 301 Moved Permanently — the page has moved for good. Use this when you change a URL or merge pages. Search engines transfer signals to the new URL.
  • 308 Permanent Redirect — like 301, but preserves the request method. Also treated as permanent.
  • 302 Found / 307 Temporary Redirect — the move is temporary. Use these only when the original URL will return.

4xx: client errors

  • 404 Not Found — the page does not exist. Normal for deleted content, but internal links pointing to 404s should be fixed.
  • 410 Gone — the page was intentionally removed and will not return. Can be dropped from the index slightly faster than 404.
  • 403 Forbidden — the server refuses access. If crawlers receive 403 on pages you want indexed, check server and firewall rules.

5xx: server errors

  • 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable — the server failed. Frequent 5xx errors can slow crawling and, if persistent, lead to pages being dropped. Use 503 with a Retry-After header for planned maintenance.

Check any URL

The website status checker shows the status code, the full redirect chain, response time and important headers such as cache-control and x-robots-tag.

Redirects done right

Redirects are essential during site changes, but poorly managed redirects waste crawl effort and dilute signals.

Redirect best practices

  • Use permanent redirects for permanent moves. 301 or 308.
  • Redirect to the most relevant page. Sending every old URL to the homepage is a poor experience and is often treated like a soft 404.
  • Avoid redirect chains. A → B → C should become A → C. Each extra hop slows users and crawlers.
  • Avoid redirect loops. A → B → A breaks the page entirely.
  • Update internal links. Link directly to the final URL rather than relying on redirects.
  • Keep redirects in place. Old URLs may have backlinks; keep redirects active for the long term.

Common redirect scenarios

  • Moving from HTTP to HTTPS
  • Choosing between www and non-www
  • Adding or removing trailing slashes consistently
  • Changing URL structure during a redesign
  • Merging thin or duplicate pages

Each should resolve in a single hop to the final, canonical URL.

Canonical tags: choosing the preferred URL

The same content is often available at several URLs — with tracking parameters, sorting options, printer-friendly versions or both http and https. A canonical tag tells search engines which version you prefer:

<link rel="canonical" href="https://example.com/running-shoes/" />

Canonical best practices

  • Add a self-referencing canonical on every indexable page.
  • Use absolute URLs.
  • Point duplicates and parameter versions to the main version.
  • Make sure the canonical URL returns 200, is indexable and is included in your sitemap.
  • Do not canonicalise paginated pages to page one if they contain unique items.

A canonical is a strong hint, not a command. If other signals strongly contradict it, search engines may choose a different canonical.

Indexing directives: noindex and friends

Meta robots tags and the X-Robots-Tag HTTP header control indexing:

<meta name="robots" content="noindex, follow" />

Common directives

  • noindex — do not show this page in search results.
  • nofollow — do not follow the links on this page.
  • noarchive, nosnippet, max-snippet — control how results are displayed.

When to use noindex

  • Thank-you and confirmation pages
  • Internal search results
  • Thin tag or archive pages
  • Staging and test environments (better still, protect them with a password)

A critical mistake to avoid

A noindex directive only works if crawlers can see it. If you block a page in robots.txt, the crawler never reads the noindex tag. To remove a page from results, allow crawling and use noindex.

Crawlers discover pages mainly through links. A clear structure helps them find and understand your content.

  • Keep important pages close to the homepage — ideally within three clicks.
  • Avoid orphan pages — every indexable page should have at least one internal link.
  • Use descriptive anchor text — "keyword difficulty guide" is better than "click here".
  • Fix broken internal links — use the broken link checker to scan any page.
  • Use breadcrumbs — they help users and add helpful structure, especially with BreadcrumbList structured data.

Mobile, speed and HTTPS

Mobile-friendly pages

Search engines primarily use the mobile version of a page for indexing and ranking. Make sure your site has a viewport meta tag, readable text without zooming, tap targets that are easy to press and no horizontal scrolling.

Page speed and Core Web Vitals

Core Web Vitals measure real-world user experience:

  • LCP (Largest Contentful Paint) — how quickly the main content loads. Aim for under 2.5 seconds.
  • INP (Interaction to Next Paint) — how quickly the page responds to interactions. Aim for under 200 milliseconds.
  • CLS (Cumulative Layout Shift) — how much the layout jumps around. Aim for under 0.1.

Common improvements include compressing images, serving modern formats such as WebP or AVIF, setting image dimensions, deferring non-critical JavaScript and enabling caching and compression.

HTTPS everywhere

Serve every page over HTTPS, redirect HTTP to HTTPS in one hop and fix any mixed content (HTTP images or scripts on HTTPS pages).

Structured data

Structured data (usually JSON-LD) describes your content in a machine-readable way — articles, products, FAQs, organisations, breadcrumbs and more. It can make pages eligible for rich results.

  • Use the type that matches your content.
  • Include required properties.
  • Keep it consistent with what users see on the page.
  • Validate it with the schema markup validator and confirm eligibility with Google's Rich Results Test.

A technical SEO checklist

Use this list for a quick health check:

  • robots.txt exists, blocks only low-value areas and lists your sitemap
  • XML sitemap is valid and contains only canonical, indexable 200 URLs
  • Sitemap submitted to search consoles
  • Important pages return 200
  • Redirects are permanent where appropriate and resolve in one hop
  • No internal links point to 404s or redirects
  • Every indexable page has a self-referencing canonical
  • No important page is noindexed or blocked
  • HTTPS everywhere with no mixed content
  • Mobile-friendly layout with a viewport tag
  • Core Web Vitals reviewed and improved
  • Structured data valid where used

Download the printable SEO audit checklist for a more detailed version.

Run a full audit

For a quick check of any individual page, the SEO audit tool fetches the live page and reviews more than 20 factors — status code, HTTPS, title, description, headings, canonical, indexability, viewport, image alt text, structured data, internal links, robots.txt and sitemap — then gives you a score and a prioritised list of fixes.

How often to check technical SEO

  • Weekly: glance at crawl and indexing reports for sudden drops.
  • Monthly: scan important pages for broken links and status changes.
  • After every release: test robots.txt, sitemaps and key templates.

Final thoughts

Technical SEO can sound intimidating, but the fundamentals are straightforward. Make sure crawlers can reach your important pages, give them a clean sitemap, return the right status codes, consolidate duplicates with redirects and canonicals, and keep unwanted pages out of the index with noindex.

Check these basics whenever you launch a site, redesign it or notice pages dropping out of search. A few minutes with the free tools linked in this guide can prevent problems that would otherwise undo months of content work.