Contact form for Jekyll
Jekyll sites are static, so form posts need an external endpoint. Keep the form in an include and the form ID in _config.yml, so every page and theme uses the same form.
Get my free form link Replace YOUR_FORM_ID below with your form ID, or copy the snippets from your dashboard where it's already filled in.
Step by step
- Create a form in Pasteform and copy its ID (starts with
f_). - Add
pasteform_id: YOUR_FORM_IDto_config.ymland restartjekyll serve. - Create
_includes/contact-form.htmlwith the code below. - Use
{% include contact-form.html %}in any page or layout. Kramdown passes the HTML through.
_config.yml
pasteform_id: YOUR_FORM_ID
_includes/contact-form.html
<form action="https://forms.prizenlabs.com/f/{{ site.pasteform_id }}" method="POST">
<input type="hidden" name="_redirect" value="{{ site.url }}/thanks/">
<label>Name <input type="text" name="name" required></label>
<label>Email <input type="email" name="email" required></label>
<label>Message <textarea name="message" required></textarea></label>
<input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
<button type="submit">Send</button>
</form>
Allowed domains
Add your domain (and localhost for jekyll serve).
Common pitfalls
- The
_redirectURL must be on an allowed domain, or on the same host as the form page when the allow-list is empty. - Create
thanks.mdwithpermalink: /thanks/for the redirect target.
What you get
- Email notifications with Reply-To set to your visitor, plus optional Slack, Discord, Telegram or webhook alerts.
- Spam protection: honeypot, rate limits, domain allow-list, optional Cloudflare Turnstile.
- Submissions stored for as long as you choose (or not at all), with CSV export and one-click deletion.
- Free for 250 submissions a month; Pro is $9/month for 5,000.
Guides for other platforms
Lovable · Bolt · v0 · Framer · Webflow · Astro · Next.js · Hugo · GitHub Pages · Netlify · Vercel · WordPress (static export) · Carrd · plain HTML