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:

  1. The form has errors, then show error messages properly.
  2. 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
2
3
4
<form method="POST">
<input type="text" name="name" />
<input type="text" name="email" />
</form>

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
2
3
4
<form method="POST">
<input type="text" name="user_name" />
<input type="text" name="email" />
</form>

Then it works well.

NOTE: Beside name, actually there are others reserve words like day, month and year

Hope this helps :)

Reference: 404 pops after custom form submission by POST