When you create a complex form that will be used on page or anywhere in WordPress, there are some restrictions that you will not found documented, and will cause you a lot of problems if you are not aware of them and how to solve them.
I am working on a project and a page with form, and form required a field for year of birth. Form I made was submitted using POST method. And I named the field for year of birth, simply: year. And I set the year field and submit the form, and instead form getting saved, I am redirected to 404 page. If I don’t set year field, everything is OK.
It took me some time to realize that WordPress is parsing the requests (even POST) and uses elements if they are recognized as rewrite elements. And year is one of the elements used to create rewrite rules. I renamed field to birth_year and everything was working fine. I didn’t had the time to test with older version of WordPress, but this problem is present in both WordPress 2.9 and WordPress 3.0.
This is a problem that can even be considered as bug, because parsing POST request for URL parameters is not needed. Only if the form is submitted as GET, these parameters can cause trouble.
So, to avoid problems with naming the form fields don’t use reserved keywords (even so they are not actually reserved, they might as well be) like:
year, monthnum, day, hour, minute, second, postname, post_id, pagename, category, tag, author, pagename and search.
Each of the field elements named using keywords in bold above, with value set will break the form and cause redirection problems, usually ending at 404 page.





