🔥 All-Access Pass — $199 USD (Regular $499) · Unlock all 2,836 Astro themes ➔
komal.nakrani
Get All-Access Pass ($199)
ThemesCategoriesDocsBlogTips & TricksPricingGet All-Access Pass ($199)
Astro Themes••By Komal Nakrani

Build a Medical Clinic Website with Astro

Build a medical clinic website with Astro: treatments and practitioners as content collections, booking links, MedicalClinic schema, privacy-safe forms, hosting.

#Astro#Medical Clinic Website#Healthcare#Local SEO

To build a medical clinic website with Astro, model treatments and practitioners as content collections, send appointment requests to an external booking system instead of a plain contact form, add MedicalClinic structured data with opening hours, and deploy the static build to a CDN host. A static Astro site suits a clinic because it is fast on mobile, has no login or database to secure, and keeps patient data off your web server entirely.

This guide covers the pages a clinic site needs, the Astro 7 code for each, and the privacy and local SEO details that matter more for healthcare than for most sites.

Key Takeaways

  • Patients look for treatments, the people who will treat them, opening hours, location and a way to book. Build those first.
  • Keep health information out of your website forms. Link to a booking or patient portal that is built for medical data.
  • Use content collections for treatments and practitioners so each gets its own indexable page.
  • Add MedicalClinic JSON-LD with address, phone and openingHoursSpecification for local search.
  • Have a clinician review every medical statement before it goes live.

What patients look for on a clinic website

Visitors to a clinic site usually arrive with a specific question: do you treat this, who will I see, when are you open, and how do I book. Answer those on every page and the site works.

Page What it must answer
Home What you treat, where you are, how to book, hours
Treatments One page per treatment: what it is, who it’s for, how long, what to expect, cost or insurance notes
Practitioners Name, credentials, specialties, photo, languages spoken
Book Link or embed to your booking system, phone number
Location and hours Map, parking, accessibility, opening hours, holiday closures
Patient info New patient forms, insurance, cancellation policy, FAQs
Journal Health articles reviewed by your clinicians

A clinic’s phone number should be a tel: link in the header on mobile. Many patients still prefer to call.

Create the project

# Terminal
npm create astro@latest clinic-site
cd clinic-site
npx astro add sitemap
npm run dev

Prefer to start from a design? The Astro medical themes category has 77 themes at the time of writing. Auric Clinic Glow is built for a clinic that has to earn trust first, with Treatments, Practitioners and a Book a consultation page, and Dental Health puts visit count and chair time at the top of each treatment page. If you want a free base instead, Astro’s official starter templates or a general business template like AstroWind can be adapted, though you’ll build the treatment and practitioner pages yourself.

Model treatments and practitioners

// src/content.config.ts
import { defineCollection, reference } from 'astro:content';
import { glob } from 'astro/loaders';
import { z } from 'astro/zod';

const practitioners = defineCollection({
  loader: glob({ pattern: '**/*.md', base: './src/content/practitioners' }),
  schema: ({ image }) =>
    z.object({
      name: z.string(),
      credentials: z.string(),
      role: z.string(),
      languages: z.array(z.string()).default(['English']),
      photo: image(),
      photoAlt: z.string(),
    }),
});

const treatments = defineCollection({
  loader: glob({ pattern: '**/*.md', base: './src/content/treatments' }),
  schema: z.object({
    title: z.string(),
    summary: z.string().max(200),
    duration: z.string(),
    visits: z.string().optional(),
    priceFrom: z.number().optional(),
    practitioners: z.array(reference('practitioners')),
    reviewedBy: reference('practitioners'),
    reviewedOn: z.coerce.date(),
  }),
});

export const collections = { practitioners, treatments };

The reviewedBy and reviewedOn fields matter. Health content is held to a higher standard by search engines and by patients, and showing who reviewed a page and when is honest and useful. Make the field required so nobody can publish an unreviewed treatment page.

---
# src/content/treatments/teeth-whitening.md
title: "Teeth whitening"
summary: "In-chair whitening in one visit, with take-home trays for top-ups."
duration: "90 minutes"
visits: "1 visit"
priceFrom: 350
practitioners: ["dr-amara-singh"]
reviewedBy: "dr-amara-singh"
reviewedOn: 2026-10-20
---

## Who it's for

Adults with healthy teeth and gums who want a brighter shade.

The content collections guide explains reference() and schemas in detail.

Treatment pages that answer real questions

---
// src/pages/treatments/[id].astro
import { getCollection, getEntries, getEntry, render } from 'astro:content';
import BaseLayout from '../../layouts/BaseLayout.astro';
import BookButton from '../../components/BookButton.astro';

export async function getStaticPaths() {
  const treatments = await getCollection('treatments');
  return treatments.map((t) => ({ params: { id: t.id }, props: { treatment: t } }));
}

const { treatment } = Astro.props;
const { Content } = await render(treatment);
const team = await getEntries(treatment.data.practitioners);
const reviewer = await getEntry(treatment.data.reviewedBy);
const reviewed = treatment.data.reviewedOn.toLocaleDateString('en-US', { dateStyle: 'long' });
---
<BaseLayout title={treatment.data.title} description={treatment.data.summary}>
  <h1>{treatment.data.title}</h1>
  <dl class="facts">
    <div><dt>Time in clinic</dt><dd>{treatment.data.duration}</dd></div>
    {treatment.data.visits && <div><dt>Visits</dt><dd>{treatment.data.visits}</dd></div>}
    {treatment.data.priceFrom && <div><dt>From</dt><dd>${treatment.data.priceFrom}</dd></div>}
  </dl>
  <Content />
  <h2>Who you'll see</h2>
  <ul>{team.map((p) => <li><a href={`/practitioners/${p.id}/`}>{p.data.name}, {p.data.credentials}</a></li>)}</ul>
  <p class="review">Medically reviewed by {reviewer.data.name}, {reviewer.data.credentials}, on {reviewed}.</p>
  <BookButton />
</BaseLayout>

Put the practical facts (time, visits, price) above the description. Patients compare these first, and they are what an AI assistant is most likely to quote when someone asks about your clinic.

Booking without collecting health data on your site

Most clinics already use a practice management or booking system that offers a public booking page. Link to it. That system is designed for patient data, has the right agreements in place, and handles reminders and cancellations.

---
// src/components/BookButton.astro
const bookingUrl = import.meta.env.PUBLIC_BOOKING_URL ?? '/contact/';
---
<div class="book">
  <a class="btn" href={bookingUrl} rel="noopener">Book an appointment</a>
  <a href="tel:+15551234567">Or call (555) 123-4567</a>
</div>

Keep the booking URL in an environment variable (PUBLIC_BOOKING_URL in .env) so changing providers is a one-line change. The environment variables guide covers how PUBLIC_ variables work in Astro.

If you do add a general contact form, label it clearly: “Please don’t include medical details. For appointments, use our booking page.” Generic form backends are not built for health information, and in many countries sending it through one creates compliance problems. When you need intake forms, use the ones your patient portal provides.

Local SEO and MedicalClinic schema

Most clinic searches are local: “physiotherapist near me”, “dentist in Riverside”. Three things carry most of the weight:

  1. A complete Google Business Profile with the same name, address and phone as your site.
  2. A location page with the full address in text (not only in a map image), parking and transit notes.
  3. MedicalClinic structured data on the home and location pages.
---
// src/components/ClinicSchema.astro
const schema = {
  '@context': 'https://schema.org',
  '@type': 'MedicalClinic',
  name: 'Riverside Family Dental',
  url: Astro.site?.href,
  telephone: '+1-555-123-4567',
  address: {
    '@type': 'PostalAddress',
    streetAddress: '200 River Road, Suite 4',
    addressLocality: 'Riverside',
    addressRegion: 'CA',
    postalCode: '92501',
    addressCountry: 'US',
  },
  openingHoursSpecification: [
    { '@type': 'OpeningHoursSpecification', dayOfWeek: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], opens: '08:00', closes: '18:00' },
    { '@type': 'OpeningHoursSpecification', dayOfWeek: 'Saturday', opens: '09:00', closes: '13:00' },
  ],
  medicalSpecialty: 'Dentistry',
};
---
<script type="application/ld+json" set:html={JSON.stringify(schema)} />

Check the type against schema.org’s MedicalClinic definition and use Dentist or Physician if those fit better. For more on generating schema from content, see the JSON-LD guide.

Accessibility is not optional for healthcare

Patients include older adults, people with low vision and people who are unwell while browsing. Build for them:

  • Body text at 16px or larger with generous line height.
  • Contrast at WCAG AA or better, including on buttons.
  • Every image has alt text; Astro’s <Image /> component refuses to build without it.
  • Opening hours and phone numbers as real text, never only inside images.
  • Visible focus styles on links and buttons.
  • No auto-playing video or carousels that move on their own.

In some regions, healthcare providers face legal accessibility requirements, so check what applies to you.

Performance on mobile networks

Clinic sites are mostly visited on phones, often from a car park or waiting room. Astro’s defaults help a lot: no JavaScript unless you add it, and images processed through astro:assets.

---
// src/components/PractitionerCard.astro
import { Image } from 'astro:assets';
const { practitioner } = Astro.props;
---
<a href={`/practitioners/${practitioner.id}/`} class="card">
  <Image src={practitioner.data.photo} alt={practitioner.data.photoAlt} width={320} height={320} />
  <span>{practitioner.data.name}</span>
  <span>{practitioner.data.role}</span>
</a>

Embedding a full interactive map on every page is the most common performance mistake on clinic sites. Show a static map image or a “Get directions” link to a maps app, and load an interactive map only on the location page.

Deploy and maintain

Run npm run build and deploy dist/ to Cloudflare Pages, Netlify or Vercel. The static deployment docs walk through each host. Because the site is static, there’s no admin login to attack and no plugin updates to apply.

The maintenance that does matter is content: update holiday hours, remove practitioners who have left, and re-review treatment pages at least once a year. The reviewedOn date in your schema makes that easy to audit. For a broader walkthrough of deploying, see the Astro deployment guide.

FAQ

Is Astro a good choice for a medical clinic website?

Yes. Astro builds static pages that load quickly on phones, and a static site has no database or login to secure. Treatments and practitioners fit content collections well, and bookings can go to your existing practice management system through a link.

Can I take appointment bookings on an Astro site?

Yes, by linking or embedding the public booking page from your booking or practice management system. That system stores patient details and sends reminders, so your Astro site never handles health information itself.

Is a static website HIPAA compliant?

A static site that collects no patient information keeps protected health information off your web server, which removes most of the risk. Compliance depends on the whole setup, though, including any forms, analytics and booking tools, so check each service and consult a compliance professional.

What schema markup should a clinic website use?

Use the schema.org MedicalClinic type, or a more specific one such as Dentist or Physician, with name, address, telephone, opening hours and medical specialty. Keep the details identical to your Google Business Profile.

How do I show who reviewed health content on an Astro site?

Add reviewedBy and reviewedOn fields to your treatment or article schema, reference a practitioner entry, and render a “Medically reviewed by” line on each page. Making the fields required stops unreviewed pages from being published.