SEO Fundamentals: Technical SEO, Sitemaps and Search Console
Business & ProductLesson 4 of 45 min read
What you'll learn
- Write a correct robots.txt and understand what it can and cannot do
- Generate an XML sitemap and submit it
- Explain LCP, INP and CLS and what usually causes poor scores
- Run a monthly Search Console routine and recognise spam tactics to avoid
On this page
A board-game cafe redesigns its site over a weekend. On Monday it is happy: faster, prettier. By Friday, organic visits have halved. Nothing about the content changed. The developer had copied a robots.txt from the staging server that blocked everything, and the new URLs no longer matched the old ones, with no redirects. None of that is visible in the design. Technical SEO is the layer that makes a site reachable, stable and measurable, and most of it is checks you can run in an afternoon.
robots.txt: crawl rules, not a lock
A robots.txt file at the root of a domain tells well-behaved crawlers which paths they may fetch. It controls crawling, not indexing: a blocked URL can still appear in results, without a snippet, if other pages link to it. To keep a page out of results, use a noindex directive and leave the page crawlable so the bot can see it. And robots.txt is not security. Anyone can read it, and it will not stop a hostile visitor, so never use it to hide private paths.
User-agent: *
Disallow: /cart/
Disallow: /search
Allow: /
Sitemap: https://www.example.com/sitemap.xmlYou can test rules before shipping them. Python's standard library includes a parser, so this check can run in your release pipeline.
from urllib.robotparser import RobotFileParser
robots = """\
User-agent: *
Disallow: /cart/
Disallow: /search
Allow: /
Sitemap: https://www.example.com/sitemap.xml
""".splitlines()
rp = RobotFileParser()
rp.parse(robots)
for path in ["/", "/events/trivia-night", "/cart/checkout", "/search?q=chess"]:
print(f"{path:<24} crawlable: {rp.can_fetch('*', 'https://www.example.com' + path)}")Output
/ crawlable: True /events/trivia-night crawlable: True /cart/checkout crawlable: False /search?q=chess crawlable: False
XML sitemaps
A sitemap lists the URLs you want indexed, optionally with a last-modified date. It does not force indexing but it helps discovery, especially for new sites, large sites and orphan pages. Include only canonical, indexable URLs that return a success status, keep them in one consistent host and protocol, and use accurate modification dates (a date that changes on every deploy teaches the engine to ignore it). Remember to escape special characters such as the ampersand.
from datetime import date
from xml.sax.saxutils import escape
pages = [
("https://www.example.com/", date(2025, 3, 1)),
("https://www.example.com/events/trivia-night", date(2025, 2, 20)),
("https://www.example.com/menu?type=a&b", date(2025, 1, 5)),
]
lines = ['<?xml version="1.0" encoding="UTF-8"?>',
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">']
for url, modified in pages:
lines.append(f" <url><loc>{escape(url)}</loc><lastmod>{modified.isoformat()}</lastmod></url>")
lines.append("</urlset>")
print("\n".join(lines))Output
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url><loc>https://www.example.com/</loc><lastmod>2025-03-01</lastmod></url> <url><loc>https://www.example.com/events/trivia-night</loc><lastmod>2025-02-20</lastmod></url> <url><loc>https://www.example.com/menu?type=a&b</loc><lastmod>2025-01-05</lastmod></url> </urlset>
Page experience and Core Web Vitals
Core Web Vitals are three field-measured metrics describing real users' experience of loading, interaction and visual stability. As of this writing Google's published guidance describes them as follows, but check the current documentation for exact thresholds and any changes.
| Metric | Measures | Guideline for "good" | Common causes of poor scores |
|---|---|---|---|
| LCP (Largest Contentful Paint) | How quickly the main content appears | About 2.5 seconds or less | Large unoptimised hero images, slow server response, render-blocking resources |
| INP (Interaction to Next Paint) | How quickly the page responds to taps and clicks | About 200 milliseconds or less | Long JavaScript tasks, heavy third-party scripts |
| CLS (Cumulative Layout Shift) | How much content jumps around while loading | About 0.1 or less | Images and ads without reserved size, late-loading fonts or banners |
Two things to keep in perspective. First, these are one input among many, and a fast page does not outrank a far more relevant one; their larger effect is on real visitors, who leave slow or jumpy pages. Second, the data that matters is field data from real users (shown in Search Console's Core Web Vitals report), while lab tools such as Lighthouse are for diagnosing. Typical fixes are to compress and size images, set explicit width and height on media, defer non-critical scripts, use a CDN and cache, and trim third-party widgets.
A Search Console routine
Search Console is free and shows how the search engine sees your site. Verify the domain, submit the sitemap, then adopt a short monthly habit.
1. INDEXING / PAGES REPORT
- Did "not indexed" counts jump? Open the biggest reason group.
- Spot-check three important URLs with URL Inspection.
2. SITEMAPS
- Status is "Success"; submitted count roughly equals indexable pages.
3. PERFORMANCE REPORT (last 3 months vs previous period)
- Queries with high impressions and low click-through: rewrite the
title and description.
- Queries with positions just below the first page: strengthen the
page, add internal links.
- Pages that lost clicks: check recent changes before assuming
an algorithm change.
4. CORE WEB VITALS AND PAGE EXPERIENCE
- Note URL groups marked "poor"; hand them to a developer.
5. MANUAL ACTIONS AND SECURITY ISSUES
- Both should be empty. If not, fix and request a review.
6. WRITE DOWN: what changed on the site this month, and what you will
change next. Later you can connect cause and effect.Spammy tactics to avoid
Search engines publish spam policies, and violating them can reduce visibility or cause a manual action. The recurring offenders are worth knowing so you can recognise them when an agency proposes them.
- Keyword stuffing: repeating phrases unnaturally in text, titles or hidden spots.
- Hidden text and links: white text on white, off-screen positioning or tiny fonts for bots only.
- Cloaking and sneaky redirects: showing crawlers one page and users another.
- Link schemes: buying links, large-scale exchanges or automated link-building.
- Scaled low-value content: mass-producing thin, automatically generated or scraped pages, including doorway pages made only to funnel visitors.
- Expired-domain and reputation abuse: hosting unrelated third-party content to borrow a site's standing.
Common mistakes
- Shipping staging robots rules to production. Symptom: traffic drops sharply after launch and Search Console reports "Blocked by robots.txt". Fix: automated release check on the live robots.txt.
- Changing URLs without 301 redirects. Symptom: a spike of "Not found (404)" for formerly strong pages and lost rankings. Fix: map every old URL to its new equivalent with a permanent redirect.
- Blocking a page in robots.txt to deindex it. Symptom: the URL stays in results with no snippet. Fix: allow crawling and use noindex, or remove it properly.
- Sitemaps full of redirected, noindexed or error URLs. Symptom: Search Console lists many submitted URLs as excluded. Fix: generate the sitemap from the list of indexable canonical pages only.
- Optimising only the lab score. Symptom: a green Lighthouse run but poor field data. Fix: use field data from real users to prioritise.
How this shows up in real projects and interviews
Technical SEO is most often a launch-week concern: migrations, redesigns and framework changes are when sites lose visibility, so developers who add redirect maps and robots checks to the release process are valued. Page-speed work overlaps with general front-end performance, and CSS fundamentals and JavaScript fundamentals cover things like layout stability and script cost. In interviews, "how would you migrate a site without losing traffic?" has a clear structure: inventory URLs, map redirects, keep content equivalent, check robots and sitemaps, monitor Search Console afterwards.
Try it yourself
Write a pre-launch SEO checklist for a site migration with at least eight items covering robots.txt, redirects, sitemap, canonicals, titles, structured data, performance and monitoring, and say which one you would verify on the live site first.
Show a hint
Start with whatever could make the whole site disappear: the live robots.txt and any noindex tag. Then verify redirects for the highest-traffic old URLs.
Key takeaways
- robots.txt manages crawling, not indexing, and is not a security measure; use noindex to keep pages out of results.
- Sitemaps should list only canonical, indexable, successful URLs with honest dates.
- Core Web Vitals (LCP, INP, CLS) describe loading, responsiveness and stability; use field data and confirm thresholds in current documentation.
- A monthly Search Console routine catches indexing problems and shows which queries and pages to improve.
- Avoid hidden text, cloaking, link schemes and mass low-value pages; they risk lasting damage.
Test yourself
A trick from this lesson's ride: robots.txt closes the road, not the catalogue: to delist, let the bot in and say noindex. Four more tricks like it wait along the route, each followed by a question.
Frequently asked questions
What is the difference between robots.txt and a sitemap?
Robots.txt tells crawlers which paths they should not fetch, while a sitemap lists the URLs you want discovered and indexed. One restricts crawling, the other helps discovery, and they are often used together, with the sitemap location listed in robots.txt.
What are Core Web Vitals?
They are three metrics for real-user experience: Largest Contentful Paint for loading, Interaction to Next Paint for responsiveness and Cumulative Layout Shift for visual stability. They are one part of page experience, and the exact thresholds are set in Google's documentation.
How do I submit a sitemap to Google Search Console?
Verify your site in Search Console, open the Sitemaps report, enter the sitemap URL such as sitemap.xml and submit it. Check the status afterwards and compare the number of discovered URLs with your expected indexable pages.