jibbylt / revival-direct-coaches

This is the public website of revivaldirectcoaches.co.uk built in raw HTML, CSS and Javascript using video on the homepage from Shutterstock. Hosted via Netlify.
https://revivaldirectcoaches.co.uk
MIT License
0 stars 0 forks source link

Spam #13

Closed jibbylt closed 2 years ago

jibbylt commented 2 years ago

Bots are sending spam into the 'contact us' form field

I have some code at https://docs.netlify.com/forms/spam-filters/ which will help

Extra spam prevention For additional protection to help prevent abuse of your forms, you can add a honeypot field, a reCAPTCHA 2, or both. We automatically reject submissions that do not pass these challenges. Junk submissions caught by a honeypot field or reCAPTCHA 2 won’t even be included in your form’s spam submissions. The Submissions page for a form will indicate if it has any extra spam prevention enabled.

Honeypot field

“Honeypot” fields are hidden form fields that lure bot users into completing a field that human users can’t see. A form submitted with a completed honeypot field can be safely rejected because only a bot would see and complete the field. You can alert Netlify to a hidden honeypot field by adding a netlify-honeypot attribute to your

with the name of your hidden field. Then make sure that field is present in the form, but hidden via CSS or JavaScript.

Here’s an example:

When Netlify’s build bots parse the static HTML during post-processing, they automatically strip the netlify-honeypot attribute from the

tag, leaving the honeypot input field in place. In the example above, if a spambot enters any value in bot-field, Netlify will quietly reject the form submission.

If you submit your form via AJAX, make sure that the honeypot field name is included in the body of the POST request.

reCAPTCHA 2 challenge

If you would like to add a reCAPTCHA 2 challenge to a form, Netlify can include one for you, or you can add your own.

Netlify-provided reCAPTCHA 2

To have Netlify provide the CAPTCHA:

Add a data-netlify-recaptcha="true" attribute to your tag. In the place where you’d like the CAPTCHA to appear, add an empty

element inside your form with the same data-netlify-recaptcha="true" attribute. When your site is published, the form will include the necessary HTML to render the CAPTCHA.

Here’s an example:

When a visitor submits the form, our servers will validate the CAPTCHA server-side. If the validation fails, we’ll redirect the visitor back to the same page and reject the form submission.

philanderson888 commented 2 years ago

Issue has been coded and worked on. Fix pushed.