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.
Thanks for the solution
attachment is one of them as well. It was driving me insane!
Where do I have to go to change the form name?
Thanks for this. What an irritating bug! There are other terms that also break this, like “service”. I stumble across this every once an a while and forget and have to search for the solution again…
You save my day !
you are the best of the best, I was with this problem many hours trying everything, thank you very much from Argentina
You are awesome, lot of thanks to you.
Just giving this some 2016 love to try and keep it relevant. Worked like a charm – I’ve been stuck on this for ages!
You just saved me tons of hours of trying to find out what I got wrong.
Really appreciated mate, keep up the good work.
UNFUCKING BELIEVABLE! For 2 days I am trying to fix this bug with the redirect. Thank you!!!
Thanks, thanks a lot