SEO for Static Websites: A Practical Setup Guide

Static sites can rank as well as any CMS, but there is no SEO plugin doing the groundwork. This guide shows what to set up in your templates, build and server so search engines read your site correctly.

SEO for static websites works the same way as SEO for any site: search engines need crawlable pages, clear titles, accurate signals about which URL is the real one, and content worth ranking. The difference is that nobody installs a plugin to handle the technical groundwork. On a static site, every title tag, canonical, sitemap entry and redirect is something you put in your templates, your build or your server config.

The good news is that static sites start with a speed and simplicity advantage. This guide covers the setup you need so that advantage turns into a site search engines can read properly.

Why SEO for static websites needs its own checklist

On WordPress, an SEO plugin generates sitemaps, adds canonical tags, outputs schema and gives every page a box for its meta description. Most of that happens without anyone thinking about it.

With SEO for static websites, none of it happens unless someone builds it. Common gaps we see on static sites:

  • Every page shares the same title tag because it was hard-coded in the template.
  • No meta descriptions at all.
  • No XML sitemap, or one that was generated once and never updated.
  • “Not found” pages that return a 200 status code instead of 404.
  • Old URLs with no redirects after a redesign.
  • Content that only appears after JavaScript runs.

If you are still deciding whether static is right for you, our comparison of static vs dynamic websites covers that trade-off. The rest of this guide assumes you have a static site and want it set up properly.

Give every page its own metadata

Each page needs a unique title tag and meta description. Write them for people first: the title should say what the page is about, and the description should explain why someone would click.

On a hand-coded site, that means editing the <head> of each HTML file. On a site built with a static site generator, the clean way is to store metadata in each page’s front matter and have the base template print it. A simplified example of front matter:

---
title: "Bookkeeping for Small Agencies"
description: "Monthly bookkeeping, payroll and tax prep for agencies with 5 to 50 staff."
canonical: "https://example.com/bookkeeping-agencies/"
---

Then the template reads those fields and outputs the title, description and canonical link tags. Add a fallback so that a page missing a description fails the build, or at least shows a warning, rather than shipping with nothing.

While you are in the template, check the basics:

  1. One H1 per page that matches the page’s topic.
  2. A lang attribute on the <html> tag.
  3. A responsive viewport meta tag.
  4. Open Graph tags (title, description, image) so links look right when shared.
  5. Descriptive alt text on meaningful images.

Pick one main keyword per page and make sure no two pages target the same thing. We follow this rule on our own site because pages chasing the same query end up competing with each other.

Settle on one URL for every page

Static servers can often reach the same file through several addresses: /about, /about/, /about.html and /about/index.html. Search engines may treat these as duplicates.

Fix it in three places:

  • Pick a format, usually trailing-slash folders like /about/, and link to that format everywhere.
  • Redirect the variants to the chosen format at server level with a 301.
  • Add a self-referencing canonical tag on every page pointing at the chosen URL.

Do the same for the whole domain. HTTP should redirect to HTTPS, and either www or non-www should redirect to the other. One hop each, never a chain.

Build and maintain an XML sitemap

A sitemap tells search engines which URLs you want indexed. Most static site generators have a built-in option or a plugin to generate one on every build, which is the approach to prefer. A hand-maintained sitemap goes stale the first time someone adds a page and forgets to update it.

Rules for a sitemap that helps rather than hurts:

  • Include only canonical, indexable URLs that return a 200 status. No redirects, no 404s, no pages with noindex.
  • Use full absolute URLs with your chosen protocol and host.
  • Only add a lastmod date if it reflects real content changes. Google says it ignores the priority and changefreq fields, so do not spend time on them.
  • Stay within the size limits in Google’s sitemap documentation, and split into multiple files with a sitemap index if you exceed them.

Reference the sitemap in your robots.txt with a Sitemap: line, then submit it in Google Search Console.

A lesson from our own site: on growthscribe.com, a single large post sitemap once returned a 500 error because the server ran out of memory building it. Splitting it into smaller sitemap pages fixed it. A pre-built static sitemap avoids that particular failure, but the wider lesson holds: open your sitemap URL in a browser now and then and confirm it actually loads.

Configure robots.txt, 404s and redirects on the server

These three live outside your HTML, so they are easy to forget.

robots.txt

Create a plain robots.txt file at the root. For most small static sites it only needs to allow crawling and point to the sitemap. Use it to block crawl traps, not to hide pages from search results; a page blocked in robots.txt can still be indexed from links if others point to it. If you need a page kept out of results, use a noindex meta tag and leave it crawlable.

Check robots.txt on launch day. A Disallow: / left over from a staging build will stop the site being crawled.

Real 404 pages

Create a helpful 404.html with navigation and a search or contact option. Then make sure the server returns it with a real 404 status code. Some setups serve the 404 page with a 200 status, which search engines may treat as a thin “soft 404”. You can check the status code in your browser’s developer tools on the network tab, or with any header-checking tool.

Redirects

When a URL changes or a page is removed in favour of a better one, add a 301 redirect from the old address to the new one. On Nginx, a single redirect looks like this:

location = /old-services/ {
    return 301 /services/;
}

Keep redirects in a dedicated config file under version control, so they are not lost when the server is rebuilt.

Add structured data in your templates

Structured data (schema.org markup in JSON-LD) helps search engines understand who is behind the site and what each page is. On a static site you add it to templates, filling values from front matter.

A sensible starting set:

  • Organization or Person on the home page, with your name, logo, URL and social profiles.
  • WebSite for the site as a whole.
  • Article or BlogPosting on posts, with author and dates.
  • BreadcrumbList on pages with breadcrumbs.
  • FAQPage only where the page genuinely contains those questions and answers.

Give your Organization and Person entities a stable @id URL and reference that same @id from other pages and other sites you run. We do this across our own sites so search engines can tie everything to the same entity instead of guessing. Validate the output with Google’s Rich Results Test or the Schema Markup Validator after every template change.

Keep content in the HTML, not behind JavaScript

Some modern frameworks produce a “static” site where the HTML file is nearly empty and the content is loaded by JavaScript in the browser. Google can render JavaScript, but rendering is an extra step and other search engines and social previews may not do it well.

The safe approach: make sure the main content, headings, links and metadata are in the HTML the server sends. To check, view the page source (not the inspector) and confirm your text is there. If it is not, switch the framework to pre-render or generate pages at build time.

Use real <a href> links for navigation. Click handlers on buttons and divs are not reliably followed as links.

Protect the speed advantage

Static sites are fast by nature, but a few things undo that quickly:

  • Huge hero images. Resize images to the size they are displayed, use modern formats, and lazy-load images below the fold.
  • Long cache lifetimes missing on CSS, JavaScript and images. Use fingerprinted file names so you can cache them for a long time safely.
  • No compression. Enable gzip or Brotli on the server.
  • Heavy third-party scripts for chat, tracking and widgets. Audit what you actually need.

Check Core Web Vitals in Search Console and PageSpeed Insights after launch and after big changes. Our website speed case study shows the kind of build discipline that keeps pages fast.

Launch and monitoring routine

On launch and then monthly:

  1. Verify the domain in Google Search Console and submit the sitemap.
  2. Use URL Inspection on a few key pages to confirm Google sees the rendered content and the right canonical.
  3. Review the Pages report for unexpected exclusions, soft 404s and redirect issues.
  4. Crawl the site with a tool like Screaming Frog to catch broken links, missing titles and duplicate descriptions.
  5. Confirm forms, robots.txt and the sitemap still work after each deploy.

Much of the work in SEO for static websites lives at server level: redirects, status codes, compression, caching and SSL. If you would rather not manage that yourself, we host static and HTML sites with these settings configured from day one. You can contact us at support@growthscribe.com.

FAQ

Are static websites good for SEO?

Yes. Static sites are often fast and simple for search engines to crawl, which helps. They do not rank better automatically, though. You still need unique titles and descriptions, a sitemap, correct redirects and status codes, structured data and useful content, all set up by hand or through your build.

How do I add an XML sitemap to a static website?

The easiest way is to use your static site generator’s sitemap feature or plugin so the sitemap is rebuilt every time the site is. For a hand-coded site, create the XML file yourself and update it whenever pages change. Then list it in robots.txt and submit it in Google Search Console.

How do I set up redirects on a static website?

Redirects belong in the web server or hosting configuration, not in the HTML files. On Nginx you add location blocks that return a 301 to the new URL. Keep them in a version-controlled config file and test each one after deploying.

Do I need an SEO plugin for a static site?

There is no plugin in the WordPress sense. Instead, you build the same features into your templates and build process: metadata from front matter, an auto-generated sitemap, canonical tags and schema. Once set up in the templates, every new page gets them automatically.

Kartik Ahuja

Kartik Ahuja

Kartik is a 3x Founder, CEO & CFO. He has helped companies grow massively with his fine-tuned and custom marketing strategies.

Kartik specializes in scalable marketing systems, startup growth, and financial strategy. He has helped businesses acquire customers, optimize funnels, and maximize profitability using high-ROI frameworks.

His expertise spans technology, finance, and business scaling, with a strong focus on growth strategies for startups and emerging brands.

Passionate about investing, financial models, and efficient global travel, his insights have been featured in BBC, Bloomberg, Yahoo, DailyMail, Vice, American Express, GoDaddy, and more.

Kartik Ahuja, founder of GrowthScribe

Have a challenge in mind?

Don’t overthink it. Just share what you’re building or stuck on — I'll take it from there.

LEADS --> Contact Form (Focused)
eg: grow my Instagram / fix my website / make a logo