# Contact form for GitHub Pages

> GitHub Pages serves static files only. Post the form to Wrenform and every real submission reaches your inbox, with spam filtered.

Last updated 2026-11-17. Web version: https://wrenform.com/docs/hosting/github-pages

```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>
```

## Steps

1. [Create a form](/sign-in) and copy its form ID, or let your AI tool create one [without an account](/docs/quick-forms).
2. Put the form in any page of your site, with your form ID in the `action`. It's plain HTML, so it works with Jekyll, Hugo, Eleventy or hand-written files.
3. Add a thank-you page, for example `thanks.html`, and set its full address as the form's **Redirect to**, for example `https://USERNAME.github.io/thanks.html`. See [redirects](/docs/redirects).
4. Commit and push. GitHub Pages publishes the site as usual.
5. In the form's settings, add your site under **Allowed origins**: `https://USERNAME.github.io`, or your custom domain such as `https://example.com`.

A project site at `https://USERNAME.github.io/REPOSITORY/` has the origin `https://USERNAME.github.io`: an origin never includes the path. GitHub Pages has no server, and it doesn't need one here: the visitor's browser posts the form to Wrenform.

## Ask your AI

```text
Add a contact form to this GitHub Pages site using Wrenform. Use plain HTML that posts to https://wrenform.com/f/YOUR_FORM_ID with method POST, with name, email and message fields and the hidden _honey field. Add a thank-you page. Don't build a backend or use mailto. Then tell me to add the site's address under Allowed origins in Wrenform.
```

No form ID yet? The [prompts for AI builders](/docs/ai) let the tool create one without an account.

## Using Jekyll or Hugo

GitHub Pages builds Jekyll sites by itself. For an include that keeps the form ID in `_config.yml`, see the [Jekyll guide](/docs/frameworks/jekyll). For Hugo, see the [Hugo guide](/docs/frameworks/hugo).

## Test it

Open the published page, send the form, and you should land on your thank-you page. The submission shows in your dashboard and arrives by email. The first time, confirm the recipient address from the email we send.

## Common problems

- **`origin_not_allowed`.** The site's address isn't under **Allowed origins**, or it differs: `https://` and the exact host, with no path. See [errors](/docs/errors#origin_not_allowed).
- **You see our thank-you page, not yours.** **Redirect to** is empty, or it isn't an `https://` address.
- **No email arrives.** The recipient hasn't confirmed yet. See [notifications](/docs/notifications).

## Next steps

- [My form isn't working](/docs/troubleshooting): symptom, cause and fix.
- [Spam](/docs/spam): the honeypot, and the optional helper script that adds a timing check.
- [Fields](/docs/fields): subjects, reply-to and lists.
- [Cloudflare Pages](/docs/hosting/cloudflare-pages), [Vercel](/docs/hosting/vercel) and [Netlify](/docs/hosting/netlify): the same form on other hosts.
