An Astro launch checklist comes down to five areas: config that produces correct URLs (site, trailingSlash, redirects), SEO basics on every page (titles, descriptions, canonicals, sitemap, robots.txt), performance and accessibility checks on the real build, working forms and analytics, and a host with HTTPS and the right domain settings. Run through it against astro build and astro preview, not the dev server, because the dev server hides problems that only appear in production output.
The list below is grouped in the order you should work through it. Each item says what to check and how.
Key Takeaways
- Test the production build with
npm run build && npx astro preview, notastro dev.- Set
siteand pick one URL format; sitemaps, canonicals and Open Graph tags depend on both.- Redirect every old URL if you are replacing an existing site.
- Check the Largest Contentful Paint image,
alttext and heading order on your key templates.- Submit the sitemap in Google Search Console on launch day and watch the coverage report for a week.
1. Configuration
These settings affect every URL Astro generates, so fix them first:
-
siteis the production origin, with the exacthttps://andwwwchoice you want indexed. -
trailingSlashis'always'or'never', matchingbuild.format(directorywithalways,filewithnever), so one URL serves each page. See the trailing slash tip. -
baseis set only if the site lives in a subfolder. - No leftover experimental flags you do not understand.
- Environment variables are set on the host, and declared in
env.schemaso a missing one fails the build. -
npx astro checkpasses with no errors. -
npm run buildpasses with no warnings you have not read.
// astro.config.mjs
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';
export default defineConfig({
site: 'https://www.example.com',
trailingSlash: 'always',
build: { format: 'directory' },
prerenderConflictBehavior: 'error',
integrations: [sitemap()],
});
prerenderConflictBehavior: 'error' is cheap insurance: if two routes produce the same URL, the build fails instead of silently picking one. The config options guide explains these settings in more detail.
2. Content
- No placeholder text left anywhere. Search the source for “lorem”, “TODO” and “example.com”.
- Draft posts are excluded from collections, sitemaps and RSS.
- Dates are real, and future-dated posts are either filtered out or intended.
- Legal pages exist: privacy policy, cookie notice where required, terms if you sell anything.
- Contact details are correct in the footer, contact page and structured data.
A quick check for drafts is to filter in one place and reuse it:
// src/lib/posts.ts
import { getCollection } from 'astro:content';
export async function getPublishedPosts() {
const now = new Date();
return (await getCollection('blog', ({ data }) => !data.draft && data.pubDate <= now))
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
}
Use this helper in the blog index, tag pages, RSS feed and anywhere else posts are listed, so drafts cannot leak through one forgotten page.
3. SEO
- Every page has a unique
<title>and meta description. Check the templates, not just the home page. - Canonical URLs are absolute and self-referencing. The canonical URLs tip shows the component.
- Open Graph and Twitter tags with a 1200 by 630 image that exists.
- Sitemap builds at
/sitemap-index.xmland lists only indexable pages. -
robots.txtallows crawling and points at the sitemap. A stagingDisallow: /must not ship. - No accidental
noindextags on production pages. - One
h1per page, and headings in order. - Structured data validates in Google’s Rich Results Test for the page types you use.
- A custom 404 page exists at
src/pages/404.astro.
The full set of SEO tags is in the Astro SEO checklist. After the build, confirm robots.txt and the sitemap in dist/ rather than assuming:
npm run build
cat dist/robots.txt
grep -o '<loc>[^<]*' dist/sitemap-0.xml | head
4. Redirects from an old site
If the new Astro site replaces an existing one, every old URL that had traffic or links needs a redirect. Skipping this is the most common cause of a traffic drop after launch.
- Export the old site’s URLs from its sitemap, analytics or Search Console.
- Map each to a new URL, or to the closest relevant page. Avoid sending everything to the home page.
- Add redirects in
astro.config.mjsor your host’s redirects file. - Test a sample after deploying with
curl -I.
// astro.config.mjs (excerpt)
export default defineConfig({
redirects: {
'/services.html': '/services/',
'/blog/2019/[slug]': '/blog/[slug]/',
},
});
On a static host without an adapter, Astro writes HTML pages with a meta refresh redirect. For real 301 status codes, use your host’s redirect rules; Netlify and Cloudflare Pages read a public/_redirects file. The redirects tip compares the options.
5. Performance
- Run Lighthouse or PageSpeed Insights on the home page and one page of each template, on mobile.
- The LCP image uses
<Image />withpriority, and every other image is lazy. - No large islands hydrate on load that could use
client:visibleorclient:idle. - Fonts are self-hosted, with only the weights you use. See the Astro fonts guide.
- Third-party scripts (chat, tag managers, embeds) are loaded late or removed.
- Static assets get long cache headers. Files in
/_astro/have hashed names and can be cached for a year.
The dev toolbar’s Audit app flags image and loading problems page by page while you work. The Core Web Vitals guide covers what to do when a score is low.
6. Accessibility
- Every meaningful image has
alttext; decorative images havealt="". - Keyboard navigation works: tab through the header, menu, forms and footer.
- Focus is visible on links and buttons.
- Color contrast meets WCAG AA in both light and dark themes.
- Form fields have labels, and errors are announced.
-
<html lang>is set correctly.
Automated checks miss many real problems, such as confusing focus order or unclear link text. Spend ten minutes with a keyboard and a screen reader on the main pages.
7. Forms, analytics and integrations
- Every form submits on the production domain and the message arrives where it should.
- Spam protection is in place for public forms.
- Analytics records page views on the live domain, and your own visits are excluded if needed.
- Cookie consent behaves correctly if your analytics needs it.
- Newsletter and payment embeds work outside your test account.
Static sites usually send forms to a third-party service or a server endpoint. Static contact forms in Astro covers both. For analytics that may not need a consent banner, see privacy-friendly analytics.
8. Hosting and domain
- HTTPS works on every host name, with automatic certificate renewal.
-
wwwand the bare domain redirect to the one you chose forsite. - HTTP redirects to HTTPS.
- The host’s build uses the right Node.js version; Astro 7 needs 22.12 or later, and 22.23.4 or later from 7.4.2.
- Preview deployments are not indexable, through
noindexheaders or authentication. - You can roll back to the previous deploy in one click or one command.
The custom domain setup tip covers DNS records for the common hosts.
9. Launch day
- Deploy, then load the home page and the main templates in a private window.
- Submit
sitemap-index.xmlin Google Search Console and Bing Webmaster Tools. - Test the redirects for your top 20 old URLs.
- Send a test form submission and a test analytics event.
- Share one internal link with a colleague on a different device and network.
10. The first week
- Search Console coverage: watch for pages “Discovered, not indexed” or “Crawled, not indexed” in bulk.
- 404 reports in analytics or host logs, and add redirects for real URLs that 404.
- Core Web Vitals field data once enough visits come in.
- Form deliveries, in case a spam filter starts catching them.
After the first week, move to a regular routine; the Astro maintenance checklist covers what to do monthly and yearly.
If you are launching from a theme, most of the template-level items (titles, Open Graph tags, sitemap, 404 page) are already in place, and your work is mainly content, redirects and hosting. You can browse Astro themes by site type if you have not started building yet. The official Astro deployment guides cover host-specific settings.
FAQ
What should I check before launching an Astro site?
Check that site and URL settings are correct, every page has a unique title, description and canonical, the sitemap and robots.txt are right, old URLs redirect, images and fonts are optimized, forms and analytics work, and HTTPS and domain redirects are in place.
Should I test my Astro site with astro dev or astro preview?
Use npm run build followed by npx astro preview. The preview server serves the real production output, including the final URLs, minified assets and generated sitemap, which the dev server does not.
How do I stop search engines indexing my Astro staging site?
Serve preview and staging deployments with an X-Robots-Tag: noindex header or behind authentication, and make sure your production robots.txt and meta tags do not carry the staging rules.
Do I need redirects when moving a site to Astro?
Yes, for every old URL that had traffic or links. Map each one to its new address with a permanent redirect, using Astro’s redirects config or your host’s redirect file.
How long does Google take to index a new Astro site?
It varies from days to weeks. Submitting the sitemap in Search Console, linking to the site from existing profiles, and keeping internal links clear all help the first crawl.