Pre-built code blocks

SEO tags, sitemap and legal pages

SEO + metadata + legal generator

For when the answer to “People should find it on Google, and it needs privacy/terms pages” is yes.

Generates canonical/OG/Twitter tags, JSON-LD, sitemap.xml, robots.txt, and privacy/terms pages from the config the site already has, plus a --check that fails the build when launch placeholders remain.

Built by hand again in 9 of 20 audited projects before this existed. Each rebuild was another chance to make the mistake below.

A folded map showing a network of connected nodes with a magnifying glass over one of them, and two upright document sheets beside it each carrying a pressed stamp

Skip the rebuild

You do not write this one. It arrives in your project as ordinary source you can read, change and keep, with its audit record and its caveats beside it.

  1. Download the Playground. It is free and runs on your own machine.
  2. Start a new app and tick “People should find it on Google, and it needs privacy/terms pages”.
  3. This block is written in, along with anything else you ticked.

Download the Playground See the other blocks

The mistake it removes

The single most repetitive hand-written work in the audit (9/20 sites). Audits keep failing sites on the same two mechanical things: placeholders shipping in canonical URLs, and no privacy/terms on a site that takes money.

What is already handled

This is checked by running the block’s own tests every time its checks run. Tested means the block’s own test suite runs that code. It does not mean a live run against an outside service such as a payment provider.

What the audit found

Named rather than summarized. The reasoning behind each one ships inside the block, so it travels with the code instead of living on a page you have to trust. A finding marked fixed was fixed after the audit ran; the verdict above is still the one the audit gave.

2 more findings are written in the auditors' internal shorthand, so they are not listed here. The full text is in the report inside the block. Both were fixed after the audit, in 1b285d04e, 82557d847.

What you still have to do

A copied file cannot own your secrets, your host or your legal obligations. This is the part the block deliberately does not claim.

What lands in your project

python

  • python/seo_kit.py

Import SeoKit, or run as CLI: python3 seo_kit.py --config config.json --out output/ --check. Stdlib only. --disallow PATH (repeat it for each path) writes a Disallow line to robots.txt; without it robots.txt allows everything. --pages takes [{path, title, description, image, lastmod}]: path is required, lastmod goes in the sitemap, and title+description (BOTH, or neither) write a meta/<slug>.html head block for you to include in that page. An unknown page key is an ERROR: this generator does not accept a value and then drop it. Choosing each path: Every page URL carries the page's target keyword: lowercase, hyphens, the city for a local page, no dates or ids (`/cape-coral-realtor/`, not `/page2/`, `/2026/09/new-post/` or `/services?id=4`).

What you supply

Licensed MIT. It is a starting point, not a finished product.

Get it

Download the Playground See the other blocks

Nothing here is locked. The files are yours, in your folder, under a permissive license.

Questions

Is SEO tags, sitemap and legal pages audited?
It was audited on 2026-09-29, and the verdict was not a clean pass. 7 findings have been fixed since then, and the verdict stands until the block is audited again.
What do I still have to do myself?
Serve the generated sitemap.xml and robots.txt at your domain root, and set base_url to the real origin. The generator writes correct files; whether a crawler can fetch them at the expected path is a hosting decision it cannot make.
How do I get this code?
Download the Playground, start a new app, and tick “People should find it on Google, and it needs privacy/terms pages”. The block is written into your project as ordinary source you can read and edit.

All pre-built code blocks · Learn to build from zero · The coding guide