# Add a contact form to a GitHub Pages site

> A plain HTML form on GitHub Pages that emails you, with a thank-you page and no captcha.

Last updated 2026-11-23. Web version: https://wrenform.com/docs/guides/contact-form-github-pages

```text
Add a working contact form to this GitHub Pages site. Create the form by sending POST https://wrenform.com/api/v1/quick-forms with JSON {"email": "YOUR_EMAIL", "framework": "html"} (if you can't make HTTP requests, give me the curl command to run). Put the returned snippet on a contact page, matching the site's style: a label for each field, type="email" on the email field, and keep the _honey field exactly as returned. Add a thank-you page (thanks.html) and a hidden _redirect field whose value is that page's full https:// address on the published site, including the repository path if this is a project site (https://USERNAME.github.io/REPOSITORY/thanks.html), or the custom domain if the repository has a CNAME file. Add no dependencies, API keys, build workflows or server code. Then tell me to check my inbox for the Wrenform email and click Confirm, because messages are held until I do.
```

Replace `YOUR_EMAIL` with the address that should get the messages, and paste. This creates a [form without an account](/docs/quick-forms): no sign-up, no mail provider, free for 250 submissions a month. Nothing is forwarded until you click **Confirm** in the email we send, and unconfirmed forms are deleted after 7 days. Prefer the dashboard? [Create a form](/sign-in) and use the snippet below.

## Fastest path: ask your AI

The prompt above is the fastest path. For other projects: [AI tools](/docs/ai).

Claude Code, no account needed ([MCP server](/docs/mcp), [forms without an account](/docs/quick-forms)):

```sh
claude mcp add --transport http wrenform-quick https://wrenform.com/mcp/quick
```

No AI? Use the [HTML form](#or-paste-the-code) below.

GitHub Pages serves static files only, so there is nothing on it to receive a form. The visitor's browser posts the form straight to Wrenform, which emails you.

## Steps

1. Paste the prompt into your coding tool, or paste the HTML below into `contact.html`.
2. Add a `thanks.html` page and the `_redirect` field (below).
3. Click **Confirm** in the email from Wrenform.
4. Commit and push. GitHub Pages publishes the site as usual.

**Lock the form to your site.** A form created this way accepts posts from any site. Once you've confirmed, [sign in](/sign-in) with the same address and add your site's origin under **Allowed origins** in the form's settings (see the table below).

## Or paste the code

```html
<form action="https://wrenform.com/f/YOUR_FORM_ID" method="POST">
  <input type="text" name="name" required>
  <input type="email" name="email" required>
  <textarea name="message" required></textarea>
  <input type="text" name="_honey" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send</button>
</form>
<!-- Optional: a timing check against bots, and data-ajax to submit in place -->
<script src="https://wrenform.com/js/v1/form.js" defer></script>
```

Replace `YOUR_FORM_ID` with the ID from your form's Setup page. The script tag is optional: it adds the timing check.

## Your thank-you page

Add this inside the form, with your own address:

```html
<input type="hidden" name="_redirect" value="https://USERNAME.github.io/REPOSITORY/thanks.html">
```

The value must be a full `https://` address: a relative `/thanks.html` is ignored, and visitors see our thank-you page instead. On a **project site** the address includes the repository name, because the site lives under `/REPOSITORY/`. On a **user or organization site** (a repository named `USERNAME.github.io`) it doesn't: `https://USERNAME.github.io/thanks.html`.

We follow `_redirect` only to a safe address: while **Allowed origins** is empty, it must be on the same origin as the page that sent the form; once you add origins, it must be on one of them. Signed in, you can set **Redirect to** in the form's settings instead. See [redirects](/docs/redirects).

## Allowed origins

An origin is `https://` plus the host, never a path.

| Your site | Origin to add |
|---|---|
| User or organization site | `https://USERNAME.github.io` |
| Project site, `https://USERNAME.github.io/REPOSITORY/` | `https://USERNAME.github.io` |
| Custom domain | `https://example.com`, and `https://www.example.com` if you serve both |

With a custom domain, GitHub Pages sends visitors from the `github.io` address to it, so the form posts from the custom domain. Add that one. An origin of `https://USERNAME.github.io` covers every project site of that account.

## Using Jekyll

GitHub Pages builds Jekyll sites by itself. To keep the form ID in `_config.yml` and reuse the form as an include, follow the [Jekyll contact form guide](/docs/guides/contact-form-jekyll). For a Hugo or Eleventy site, see [Hugo](/docs/guides/contact-form-hugo) or [Eleventy](/docs/guides/contact-form-eleventy).

## Spam and email

- The hidden `_honey` field catches most bots. Keep it in the form, hidden, with `autocomplete="off"`.
- A timing check marks submissions sent less than 3 seconds after the form loaded as spam, when the form sends the timing field. The optional script in the HTML snippet adds it; see [the timing field](/docs/spam#the-timing-field). No captcha is needed.
- Messages sent before you confirm are held. A form without an account emails them when you click **Confirm**. On a form you created signed in, confirming a recipient emails the 20 most recent submissions from the last 7 days.
- Submissions are stored in the EU.

## Test it

Open the published contact page, send the form, and you should land on your thank-you page. After confirming, the message is in your inbox and your dashboard.

## Common problems

- **`403 origin_not_allowed`.** The page's origin isn't in **Allowed origins**: check `https://`, the exact host, and no path. A custom domain needs its own entry. See [troubleshooting](/docs/troubleshooting) and [errors](/docs/errors#origin_not_allowed).
- **You see our thank-you page, not yours.** The `_redirect` value is relative, misses the repository path, or is on another origin.
- **The form sends but no email arrives.** The address hasn't confirmed yet. Look for the email from Wrenform, also in spam.
- **A 404 after sending.** The `_redirect` address points to a page that isn't published. Open it in the browser to check.

## Next steps

- [GitHub Pages](/docs/hosting/github-pages): the same setup with a dashboard form.
- [HTML guide](/docs/frameworks/html): every option for a plain form.
- [Cloudflare Pages contact form](/docs/guides/contact-form-cloudflare-pages): the same form on another host.
- [Pricing](/pricing): free for 250 submissions a month, paid plans from €5.
