I came across an interesting bug on a bespoke WordPress site’s contact form recently, whereby submitting the form details took me straight to the 404 not found page, instead of the form’s action URL.
After a bit of tinkering, I figured out the problem was down to using the word ‘name’ as one of the form field’s input ID. Changing the form field from ‘name’ to ‘form_name’ fixed the issue and the form redirected to the target URL.
This 404 redirect issue is due to the fact that WordPress uses a number of reserved strings for various functions and commands and ‘name’ is one of them. It’s a good idea to attach a prefix such as ‘form_’ to the IDs of all your form fields, so there’s no risk of running into this problem.