Docs / Frameworks
Contact form for Jekyll
An include with the form, and the form ID in _config.yml. Works on GitHub Pages, with no plugin and no JavaScript.
Last updated 2026-11-14View as Markdown
{% comment %} _includes/contact-form.html
In _config.yml: wrenform_id: YOUR_FORM_ID {% endcomment %}
<form action="https://wrenform.com/f/{{ site.wrenform_id }}" method="POST">
<label>Name <input type="text" name="name" autocomplete="name" required></label>
<label>Email <input type="email" name="email" autocomplete="email" required></label>
<label>Message <textarea name="message" required></textarea></label>
<input type="text" name="_honey" style="display:none" tabindex="-1" autocomplete="off">
<button type="submit">Send</button>
</form>Steps
- Create a form and copy its form ID, or let your AI tool create one without an account.
- Add
wrenform_id: YOUR_FORM_IDto_config.yml, with your form ID. - Save the snippet as
_includes/contact-form.html. - Create
contact.mdwith front matter (layout: page,title: Contact,permalink: /contact/) and the line{% include contact-form.html %}. - Add a thank-you page, for example
thanks.mdwithpermalink: /thanks/, and set it as the form's Success URL (see redirects). - Deploy. Then add your site's origin under Allowed origins in the form's settings.
This works on GitHub Pages as is: no plugin, no build step beyond Jekyll's own, and no JavaScript. Restart jekyll serve after editing _config.yml; it isn't reloaded automatically.
Test it
Run bundle exec jekyll serve, open /contact/ and send the form. You should land on your thank-you page, see the submission in your dashboard and get an email. While testing locally, leave Allowed origins empty or add http://localhost:4000.
Common problems
- The form posts to
/f/with no ID.wrenform_idis missing from_config.yml, or the server wasn't restarted. - You see Wrenform's own thank-you page. Set the form's Success URL to your
/thanks/page. origin_not_allowed. Add the site's origin, includinghttps://, to the form's allowed origins.
Next steps
- My form isn't working: symptom, cause and fix.
- Spam: the optional helper script adds a timing check.
- Fields: subjects, reply-to and lists.
- Errors: every code and its fix.