404 error caused due to certain form element names in WordPress

One day I decided to help people out on Stackverflow with what little knowledge I had. I came across question where a user was facing a 404 ERROR when submitting a form on the page. The user was redirected to the same page when the form submitted but with 404 ERROR while that was not the case if the user visited that page directly.

Did some debugging and found that he had a value as “name” for the “name” attribute of the field which was causing the issue. It seems that WordPress uses some of these variables in its query, so submitting a form that has a field with the same name throws off the query and causes a 404 ERROR. So far Iโ€™ve found reports of these words being reserved.

  • name
  • date
  • year
  • month
  • day
  • hour
  • minute

So, try not to use these words as the value for the “name” for any form fields in your WordPress site.

 

 

  • Guest

    Sorry Shaktiman ! ๐Ÿ˜› ๐Ÿ˜‰

  • Guest

    Sorry Shaktiman ๐Ÿ˜› ๐Ÿ˜‰