Wordpress form submission get 404
Have you ever face a problem, when there is GET request, it shows the form properly. However when there is POST request, there are 2 situations:
- The form has errors, then show error messages properly.
- There is no error, it throws 404 (page not found).
I’ve struggling for few hours, and this is weird.
Example form (not working)
1 | <form method="POST"> |
Finally I found out the reason behind, because of the name="name"
. The name
is reserve word in WordPress.
So just change it to others
1 | <form method="POST"> |
Then it works well.
NOTE: Beside name
, actually there are others reserve words like day
, month
and year
Hope this helps :)