Hosting and deploy platforms
Add a contact form to GitHub Pages
GitHub Pages serves static files and runs nothing else, which is why contact pages there usually degrade into a mailto: link that opens an empty mail client and loses most visitors. The fix is a form whose action points somewhere that can receive it. Works with Jekyll, with any static generator, or with hand-written HTML.
Setup
Copy your endpoint
Create a form in the dashboard.
Add the form to your page
Plain HTML, or a Jekyll include if your Pages site uses Jekyll.
Commit and push
Pages rebuilds and the form works immediately.
GitHub Pages examples
Swap in your own endpoint and these run as-is.
<form action="https://send.webforms.to/wft_your_key" method="POST">
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<label for="message">Message</label>
<textarea id="message" name="message" rows="5" required></textarea>
<input type="hidden" name="_next"
value="https://yourname.github.io/thanks.html">
<input type="text" name="_gotcha" tabindex="-1" autocomplete="off"
style="position:absolute;left:-9999px" aria-hidden="true">
<button type="submit">Send</button>
</form>Worth knowing
- Restrict the form to yourname.github.io (or your custom domain) in the dashboard so nobody else can post to your endpoint.
GitHub Pages form FAQ
Not on its own. It serves static files and runs no server-side code. Pointing the form's action at an external endpoint works because the browser does the POST, not GitHub.
Simpler to write, worse for everyone: it opens an empty mail client, only works if one is configured, exposes your address to scrapers, and most visitors abandon it. A real form submits in place.
Related guides
Where GitHub Pages submissions can go
The guide above gets the submission to your endpoint. From there it can land anywhere: one destination on Free, several on Pro.
Need the form markup too? The template gallery has complete forms for contact, waitlist, job application and more, and the form generator builds one field by field.
Ready to wire up your GitHub Pages form?
Free for 300 submissions a month. Endpoint in under a minute, no card required.
Start free