One attribute, and the form starts collecting.
No endpoint to sign up for, no build step, no JavaScript. Mark a form you already have, publish, and what visitors send is waiting in your dashboard.
<form data-drop2run="contact">
<input name="email" type="email" required>
<textarea name="message"></textarea>
<button>Send</button>
</form>That is the whole change. The action and method are added for you as the page is served.
Two things have to be true.
The site's settings row says which one is missing rather than showing a switch that does nothing.
- plan
Your plan includes forms
A paid feature, and that is about accountability rather than cost: a form endpoint is something strangers can post to, so there has to be an account behind it. The plans page lists what each tier includes.
- switch
The switch is on for that site
Per site, not per account, so a site you have not thought about does not start accepting posts because another one does. Open the site, then its settings, then Forms visitors fill in.
- ~1 min
Give it about a minute
The switch reaches every visitor in roughly a minute, and the same in reverse: switching forms off leaves the endpoint accepting for about that long. Nothing is lost either way — a submission that lands during the gap is stored like any other.
Your file never changes. The served page does.
The rewrite happens as the page leaves, so what a browser receives has three things your HTML does not.
- action
Where it posts
action="/__d2r/forms/contact"— on your own domain, so the form posts to the site it sits on. A form that already has anactionis left completely alone, so one pointing at your CRM keeps pointing at your CRM. - method
How it posts
method="POST", added only when the form does not set one. Without it the browser sends a GET and puts every answer in the address bar. - honeypot
One hidden input
A field named
_d2r_hp, positioned off-screen and hidden from screen readers. People never see it; plenty of bots fill in everything they find. Leave it alone — it is the only spam filter that still works with JavaScript switched off.
Because the rewrite reads the file as it is served, a form that JavaScript builds after the page loads is not touched — there was no <form> in the file to find, so it gets no spam filtering and is not accepted. Writing the address yourself does not stand in for it. Put the <form> in the HTML and let JavaScript fill it in, which is the same thing Netlify asks for and for the same reason.
The name is what groups submissions.
data-drop2run="contact" names this form contact. Lower-case letters, digits and dashes, up to forty characters. Put the same name on fifty pages and it stays one form in your dashboard, with the page each submission came from recorded beside it — which is what you want for a newsletter box in a footer.
Leave the value empty and the form's own name attribute is used instead. With no usable name anywhere the form is called default rather than refused: a form that silently stopped working because of a typo in its name would be the worst failure available here.
A real page, on your domain.
Never the form quietly clearing itself, which is what a visitor sees when a submission is lost.
- it worked
A confirmation page
A tick, Your message was sent, and a link back to the page they came from. Served on your own site, so they never leave your domain.
To send them to a page of your own instead, add a hidden field naming it:
<input type="hidden" name="_redirect" value="/thanks.html">It has to be a path on this site. An address anywhere else is ignored rather than followed — a form that could send visitors off-site would make every page here a redirect anybody could aim.
- it did not
A page that says what happened
Never a blank screen, and never a pretend success. The ones you might meet:
- Too many, too fast. A burst from one place is slowed down. Somebody filling in a form by hand never reaches this.
- Not accepting at the moment. The account has used up the month's allowance, or the platform could not take the message right then. The form exists and is not answering, which is what the page says rather than pretending the page is missing.
- Posted from somewhere else. The submission did not come from a page on this site.
A form submitted with fetch gets JSON rather than a redirect — {"ok":true} on success and {"ok":false,"error":"…"} on a refusal, with the same status either way. Ask for it with Accept: application/json.
What each submission carries.
Every name in the form becomes a column. Change the HTML and new fields appear from that publish onwards, while older submissions keep exactly what they had — nothing is rewritten behind you, and the version each one arrived under is recorded, so a column that starts halfway down the list has an explanation.
Beside what was typed, each one carries the page it came from, the country it came from, and a one-way hash of the address rather than the address. Enough to recognise the same sender twice, and not enough to reach them any way but the one they gave you.
You also get one email a day summarising what arrived — counts and form names, never the messages themselves. Those stay behind your login, and nobody who fills in your form is ever emailed by us.
Worth knowing before you meet them.
64 KB, 30 fields, 4 KB an answer
Past any of those a submission is trimmed and still accepted, and marked as trimmed in your dashboard. Losing the tail of a long message beats losing the message.
No file uploads
A file in the form is dropped and the answers around it are kept, so a form with an optional attachment still works — it arrives without the attachment.
Spam is filtered, not deleted
A bot that fills the hidden field is told the message was sent and nothing is stored: it learns nothing and retries nothing. What we catch never counts against your allowance. What you mark yourself does, and is hidden from the list rather than deleted — a wrong guess should not cost you an order.
An allowance a month
Counted per account per calendar month, shared across every site you own. Reach it and forms stop accepting until the first of the next month, and you are emailed the moment it happens. Anything already in flight is kept, shown in full, and not charged for.
Handle the form in your own code.
On Pro and Team, point the form's action at a serverless function — a file such as _functions/api/contact.js — and do what this page cannot: email each message, forward it to Slack or a CRM, check it against an API. A form with its own action is never rewritten, so the two do not collide. The trade is that it is then not collected here: no list in the dashboard, no spam field, and nothing kept unless your code sends it somewhere.
Add the attribute, then test it yourself.
Publish, open the page, and send yourself a message. It shows up in the dashboard while you are still looking at it.