Rules to avoid 404 error on WordPress form submit

There are some rules that are to be kept in mind while creating form in wordpress. If you won’t follow those rules then you will get 404 page on form submit:

  1. Name Field’s name should not be name, e.g : <input type=”text” name=”name” value=”” /> is wrong, because by default wordpress use name field to identify comment submission. Don’t use name as name of input field. Write another name such as <input name=”custom_name” type=”text” value=”” />
  2. Email Field’s name also should not be email, e.g : <input name=”email” type=”text” value=”” /> is wrong, because by default wordpress use email field to identify comment submission. Don’t use name as email of input field. Write another name such as <input name=”custom_email” type=”text” value=”” />
  3. Similarly don’t keep name of any input field same as custom post type slug. For example if you have a post type testimonials then don’t use field’s name as testimonials.

Keeping in mind these points you can avoid 404 page error on form submission.

Leave a Reply