To build a wedding website with Astro, keep the schedule, travel details and FAQs in a data file, render them on a few static pages, post the RSVP form to a form backend, add a noindex tag so the site stays out of search results, and deploy it free on a static host. A wedding website built with Astro loads instantly on guests’ phones, costs nothing to host, and doesn’t come with a wedding platform’s ads or upsells.
This guide walks through the pages guests actually use, the Astro 7 code for each, and how to keep the site private.
Key Takeaways
- Guests need four things: when and where, how to get there, what to wear, and how to RSVP. Put them first.
- Store schedule, venues and FAQs in one TypeScript or JSON data file so updates happen in one place.
- Collect RSVPs with a form backend or a linked form. No server needed.
- Add
<meta name="robots" content="noindex">and leave the sitemap out to keep the site private.- For real access control, put the site behind your host’s password protection or Cloudflare Access.
What guests need from a wedding website
A wedding site has a short life and a very specific audience. Most guests visit two or three times: when the invitation arrives, when they book travel, and the day before. Design for those moments.
| Page | What it answers |
|---|---|
| Home | Names, date, city, countdown, RSVP button |
| Our story | How you met, photos (optional, but guests like it) |
| Schedule | Every event with time, venue, address, dress code |
| Travel and stay | Nearest airport, hotel blocks, parking, shuttles |
| RSVP | Attendance, meal choice, dietary needs, plus-ones |
| FAQ | Kids, gifts, weather plan, accessibility |
| Gallery | Engagement photos before, wedding photos after |
Keep it to one page with anchored sections if your wedding is small. A multi-page site helps when there are several events, like a welcome dinner, ceremony and brunch.
Start the project
# Terminal
npm create astro@latest our-wedding
cd our-wedding
npm run dev
If you’d rather customize than design, the Astro weddings and events themes category has 29 themes, mostly event and conference designs. Belle Amour is built for weddings specifically, with Our Story, Program, RSVP, Travel Stay and FAQ pages already laid out. If you want a free starting point, Astro’s minimal starter plus a single page of your own is honestly enough for most weddings; the community directory at astro.build/themes also has a few free one-page event templates.
Keep wedding details in one data file
Times and venues change. Put them in one file and every page reads from it.
// src/data/wedding.ts
export const couple = { names: 'Priya & Daniel', date: '2027-06-12T15:00:00+01:00', city: 'Bath, England' };
export const events = [
{
name: 'Welcome drinks',
start: '2027-06-11T19:00:00+01:00',
venue: 'The Pump Room',
address: 'Stall St, Bath BA1 1LZ',
dress: 'Smart casual',
},
{
name: 'Ceremony',
start: '2027-06-12T15:00:00+01:00',
venue: 'Prior Park Gardens',
address: 'Ralph Allen Dr, Bath BA2 5AH',
dress: 'Garden formal; flat shoes recommended for the lawn',
},
{
name: 'Reception and dinner',
start: '2027-06-12T18:00:00+01:00',
venue: 'The Assembly Rooms',
address: 'Bennett St, Bath BA1 2QH',
dress: 'Garden formal',
},
];
export const faqs = [
{ q: 'Are children invited?', a: 'We love your little ones, but the evening is adults only.' },
{ q: 'Is there parking?', a: 'Prior Park has no guest parking. A shuttle runs from the city centre at 2:15pm.' },
{ q: 'What if it rains?', a: 'The ceremony moves to the orangery on site.' },
];
A content collection would work too, but for a dozen entries that never need their own pages, a typed data file is simpler. TypeScript will flag a typo in a field name in your editor.
The schedule page
---
// src/pages/schedule.astro
import BaseLayout from '../layouts/BaseLayout.astro';
import { events } from '../data/wedding';
const time = new Intl.DateTimeFormat('en-GB', {
weekday: 'long', day: 'numeric', month: 'long', hour: 'numeric', minute: '2-digit',
timeZone: 'Europe/London',
});
---
<BaseLayout title="Schedule">
<h1>Schedule</h1>
<ol class="timeline">
{events.map((e) => (
<li>
<h2>{e.name}</h2>
<p><time datetime={e.start}>{time.format(new Date(e.start))}</time></p>
<p>{e.venue}, {e.address}</p>
<p>Dress code: {e.dress}</p>
<a href={`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(e.venue + ' ' + e.address)}`}>
Get directions
</a>
</li>
))}
</ol>
</BaseLayout>
Setting timeZone matters. Astro renders the page at build time on your machine or your host’s build server, which may be in another time zone. Fixing it to the wedding’s location means guests see the right time no matter where the site was built.
The directions link opens the maps app on a phone instead of loading a heavy embedded map on every visit.
A countdown without a framework
A countdown is a nice touch on the home page. It only needs a few lines of client-side JavaScript in a <script> tag.
---
// src/components/Countdown.astro
import { couple } from '../data/wedding';
---
<p class="countdown" data-target={couple.date}>
<span data-days>0</span> days to go
</p>
<script>
const el = document.querySelector<HTMLElement>('.countdown');
if (el) {
const target = new Date(el.dataset.target!).getTime();
const days = Math.max(0, Math.ceil((target - Date.now()) / 86_400_000));
el.querySelector('[data-days]')!.textContent = String(days);
}
</script>
Astro bundles the script and ships only these few lines. Days are enough; a ticking seconds counter adds motion without adding information. The countdown timer tip has a version with hours and minutes if you want it.
RSVPs on a static site
There’s no server, so the RSVP form posts somewhere else. Three practical options:
- A form backend such as Formspree, Web3Forms or Basin. You get emails and a dashboard or CSV export.
- Your host’s forms. Netlify Forms works by adding a
data-netlify="true"attribute to the form. - A linked Google Form or Tally form. The quickest route, though it leaves your site.
---
// src/pages/rsvp.astro
import BaseLayout from '../layouts/BaseLayout.astro';
const endpoint = import.meta.env.PUBLIC_RSVP_ENDPOINT;
---
<BaseLayout title="RSVP">
<h1>RSVP by 1 May 2027</h1>
<form method="POST" action={endpoint}>
<label>Your name(s) <input name="names" required /></label>
<label>Email <input name="email" type="email" required /></label>
<fieldset>
<legend>Will you join us?</legend>
<label><input type="radio" name="attending" value="yes" required /> Joyfully accepts</label>
<label><input type="radio" name="attending" value="no" /> Regretfully declines</label>
</fieldset>
<label>Number of guests
<input name="guests" type="number" min="1" max="2" value="1" />
</label>
<label>Dietary requirements <input name="dietary" /></label>
<label>A song that will get you dancing <input name="song" /></label>
<input type="hidden" name="_redirect" value="/thank-you/" />
<button type="submit">Send RSVP</button>
</form>
</BaseLayout>
Redirect field names vary by provider, so check your backend’s docs for the right hidden field. The max on guests matches how many seats you offered; enforce the real limit by checking replies against your guest list. The static contact forms guide compares backends in more depth.
Keep the site private
A wedding site includes your names, date, venues and sometimes your home city. Decide how private it needs to be.
Out of search results. Add a robots meta tag to your base layout and skip the sitemap integration:
---
// src/layouts/BaseLayout.astro
const { title } = Astro.props;
---
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex, nofollow" />
<title>{title} | Priya & Daniel</title>
</head>
<body><slot /></body>
</html>
Also add a public/robots.txt with Disallow: /. Note that noindex is what keeps pages out of results; robots.txt alone stops crawling but doesn’t guarantee a page is never listed.
Behind a password. noindex doesn’t stop someone with the link from viewing it. For real access control, use your host: some static hosts offer site-wide password protection on certain plans, and Cloudflare Access can put a login in front of a Cloudflare Pages site, with a free tier for small groups. A client-side JavaScript password is not protection, because the content is still in the HTML.
Hard-to-guess URL. Deploying to a subdomain like priya-daniel-2027.pages.dev and sharing it only on invitations is often enough. Pair it with noindex.
Photos before and after
Add engagement photos before the day and a gallery of wedding photos after. Store them in src/assets/ and use <Image /> from astro:assets so phones get small files.
---
// src/pages/gallery.astro
import { Image } from 'astro:assets';
import BaseLayout from '../layouts/BaseLayout.astro';
const photos = Object.values(
import.meta.glob<{ default: ImageMetadata }>('../assets/gallery/*.jpg', { eager: true }),
);
---
<BaseLayout title="Gallery">
<h1>Gallery</h1>
<div class="grid">
{photos.map((p, i) => (
<Image src={p.default} alt={`Wedding photo ${i + 1}`} width={600} quality={75} />
))}
</div>
</BaseLayout>
import.meta.glob picks up every JPEG in the folder, so adding photos is a drag-and-drop job. For galleries guests will browse carefully, write real alt text in a data file rather than numbering photos. The responsive images tip shows how to add widths and sizes.
Deploy for free
Run npm run build and drag the dist/ folder into Netlify’s deploy page, or connect the repo to Cloudflare Pages or Netlify for automatic deploys on every change. The static deploy docs cover both. A custom domain costs a few dollars a year if you want priyaanddaniel.com; otherwise the free subdomain works fine.
After the wedding, update the home page with a thank-you note and the photo gallery, and leave the site up as a keepsake. Static hosting costs nothing to keep running.
FAQ
Can I make a wedding website with Astro for free?
Yes. Astro is free and open source, and static hosts like Cloudflare Pages, Netlify and GitHub Pages host Astro sites on free plans. Free form backends handle RSVPs at wedding-sized volumes. The only optional cost is a custom domain.
How do I add an RSVP form to a static Astro site?
Point the form’s action at a form backend such as Formspree or Web3Forms, use Netlify Forms if you host on Netlify, or link to a Google Form or Tally form. Each service stores replies and emails you, so the site needs no server.
How do I keep my wedding website private?
Add a <meta name="robots" content="noindex, nofollow"> tag, skip the sitemap, and share the link only with guests. For real access control, use your host’s password protection or Cloudflare Access, since client-side passwords don’t protect HTML content.
Should a wedding website be one page or several?
One page with anchored sections works well for a single-day wedding with one venue. Use several pages when there are multiple events, lots of travel information or a long FAQ, so guests can find details quickly on their phones.
What should be on a wedding website?
The date and location, a schedule with times, venues, addresses and dress codes, travel and accommodation details, an RSVP form with a deadline, and an FAQ covering children, gifts, parking and weather plans. A story and photo gallery are optional extras.