What the agent does
If the production site has pages in more than one language or for more than one region, search engines need to know which version to show to whom. Wrong hreflang shows people the wrong language or drops pages. Set it up from one helper so every page lists all its versions correctly.
1. Map the versions
List the languages and regions the site serves, how URLs are structured (subdirectories, subdomains, separate domains, query parameters) and which pages exist in which versions. Flag pages that exist in only some languages.
2. Generate hreflang from one helper
For each page, output a
<link rel="alternate" hreflang="...">for every version that exists, including the page itself, using valid codes (language likeen,de, or language-region likeen-GB,pt-BR). Addx-defaultfor the version shown when no language matches. All URLs absolute and canonical.3. Keep it reciprocal and consistent
Every version must list every other version back. Each version's canonical points at itself, never at another language. Pages that are not translated list only the versions that exist.
4. Do not redirect by language
Do not force-redirect visitors or crawlers by browser language or IP; offer a language switcher instead, so crawlers can reach every version.
Done means
- Every translated page lists all its versions, including itself, with valid codes and x-default.
- hreflang links are reciprocal across versions.
- Each version is self-canonical.
- Visitors are not force-redirected by language; a switcher lets them choose.
Questions
Do I need hreflang for one language?
No. hreflang is only for sites with versions in several languages or for several regions.
Should translated pages be canonical to the English page?
No. Each language version should be canonical to itself; pointing them all at one language tells search engines to drop the others.
Can I redirect visitors by browser language?
Suggesting a language is fine; forcing a redirect stops crawlers and travellers from reaching the other versions.
Does this prompt add links to Aback Launch to my site?
No. Nothing in the prompt mentions Aback Launch or asks your agent to link to us. The only exception is an optional badge step, which stays off unless you tick it. Some prompt libraries slip their own link into your codebase by default; we think that should always be your choice.
Which coding agents does it work with?
Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, Cline, and any agent that can read your project and edit files. You can copy it as a plain prompt, save it as a Claude Code skill or a Cursor rule, or add it to AGENTS.md.
Is it safe to run on my real codebase?
The prompt makes the agent read first, show a plan and wait for your approval, and it forbids touching secrets, deploying and deleting data. Still review the changes and run your tests before you deploy, as with any change.
Changelog
- v1.0First version.