In my WP site I've got a Contact page whose URL is mysite.com/contact/ and which contains a <form> with an action attribute set to action="/contact/"

Clicking on the submit button brings me to this : mysite.com/contact/

This is the exact URL of my contact page (which works very well if I use this URL). Yet, it gives a 404 after having arrived to that URL via the submit button !

This doesn't make any sense to me, anybody can explain?

  • What's the form's method? Using a method of GET will result in additional query variables being appended, one of which might be interfering with WordPress rewrite system. Try it with the method set to POST and see if it works. May 15 '11 at 0:46
  • are you using any form plugin, if not then how you are using that form? May 15 '11 at 15:49

You're probably using an input field that contains name="name". A lot of generic words are used by WordPress itself (incl. name, so a best practise is to always prefix_ your fields, like name="prefix_name".

  • 1
    in my case I had an input with name='s' that was generating an annoying 404, thanks for the tip
    – cbaigorri
    Jan 20 '12 at 19:41

To make the answer more complete, there is another case which will generate a 404 except using generic words in the name-attribute: When you give the submit button a name attribute with ANY value, it will always redirect to a 404. So never use a name-attribute on input type='submit'

  • 1
    This is not true. Do you have an example?
    – fuxia
    Dec 20 '12 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy