Guide

How to create a sitemap (and get Google to find your pages)

If your site is new, or you’ve added pages recently, there’s a good chance Google hasn’t found all of them yet. A sitemap is the single fastest fix — here’s what it is, how to make one for whatever you built your site with, and how to tell Google it exists.

What a sitemap actually is

A sitemap is a plain file — usually at yoursite.com/sitemap.xml — that lists every page on your site you want search engines to know about. Think of it as a table of contents you hand directly to Google, instead of hoping its crawler stumbles onto every page by following links.

Search engines can and do find pages without one, by following links from your homepage and other pages. But that only works if every page is actually linked from somewhere crawlable. New pages, pages buried a few clicks deep, or pages your nav doesn’t link to are easy to miss. A sitemap removes the guesswork.

Why it matters for your gap analysis

It matters here too: without a sitemap, keyworddrift can only map your site by following the links it finds on your homepage — the same limitation search engines have. A submitted sitemap means we (and Google) see the whole picture, not just what’s one click from the front door.

How to create a sitemap

Pick whatever matches how your site is built.

Next.js (App Router)

Add a sitemap.ts file at the root of your app directory — Next.js turns it into /sitemap.xml automatically, no config needed.

// app/sitemap.ts import type { MetadataRoute } from 'next' export default function sitemap(): MetadataRoute.Sitemap { return [ { url: 'https://yoursite.com', lastModified: new Date(), priority: 1 }, { url: 'https://yoursite.com/about', lastModified: new Date(), priority: 0.7 }, // ...one entry per page you want found ] }

WordPress

If you’re running Yoast SEO or Rank Math, you already have one — it’s generated automatically at /sitemap_index.xml (Yoast) or /sitemap_index.xml (Rank Math). No WordPress SEO plugin installed? WordPress core has generated a basic /wp-sitemap.xml since version 5.5 — check that URL before installing anything new.

Webflow

Webflow generates /sitemap.xml for you automatically once your site is published — go to Site settings → SEO and make sure “Auto-generate sitemap” is on.

Framer

Framer also auto-generates a sitemap for published sites at /sitemap.xml — no setup required. Just make sure the pages you care about aren’t marked “hidden from search engines” in each page’s SEO settings.

Plain HTML (or anything else)

Write a small XML file by hand and upload it to your site’s root as sitemap.xml:

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url><loc>https://yoursite.com/</loc></url> <url><loc>https://yoursite.com/about</loc></url> <url><loc>https://yoursite.com/contact</loc></url> </urlset>

For more than a handful of pages, a free generator (search “XML sitemap generator”) will crawl your site and build the file for you.

How to submit it to Google Search Console

Having the file live isn’t enough on its own — tell Google where it is:

  1. Go to Google Search Console and verify your site if you haven’t already (a DNS record or an HTML tag from your host usually does it).
  2. In the left sidebar, click Sitemaps.
  3. Enter the path to your sitemap — usually just sitemap.xml — and click Submit.
  4. Google will fetch it within a few minutes, though actually crawling and indexing every page can take days. You can check progress any time on the same Sitemaps page.

Once your sitemap’s live

Run keyworddrift free — we’ll crawl every page it lists and show you exactly what to write next to get found on Google.

Grade my site →