Easily fix WordPress POST and REQUEST 404 error on form submission

If you have been trying to submit a form in WordPress and you are receiving a 404 error page, well the chances of the cause being using a reserved keyword can be extremely high. This is because one or many of your field name  is being reserved by WordPress.

submitting form as a POST request displays 404 in WordPress

In the below snippet, name=”calendar”  is a reserved word. Submitting the form will display the bad 404 page. In-order to avoid we can prefix it name=”mytheme_calendar” or ensure that the variables we use are not reserved by WordPress?


<form action="<?php the_permalink();?>" method="post">
        <label>Calendar</label>
        <input type="text" name="calendar"/>
    <input type="submit" value="Submit" name="qwe" value="submit" />
</form>

What do you mean “Reserved by WordPress” and “What are the keywords being reserved” ?

The following keywords or terms are being used by WordPress for important operations as a result, WordPress prevents you from using them. If you have been following WordPress best practices, you wouldn’t encounter an issue as it is a good practice to prefix every variable with a unique prefix word. This not only avoids conflict with WordPress but with other plugins and themes

  • attachment
  • attachment_id
  • author
  • author_name
  • calendar
  • cat
  • category
  • category__and
  • category__in
  • category__not_in
  • category_name
  • comments_per_page
  • comments_popup
  • custom
  • customize_messenger_channel
  • customized
  • cpage
  • day
  • debug
  • embed
  • error
  • exact
  • feed
  • hour
  • link_category
  • m
  • minute
  • monthnum
  • more
  • name
  • nav_menu
  • nonce
  • nopaging
  • offset
  • order
  • orderby
  • p
  • page
  • page_id
  • paged
  • pagename
  • pb
  • perm
  • post
  • post__in
  • post__not_in
  • post_format
  • post_mime_type
  • post_status
  • post_tag
  • post_type
  • posts
  • posts_per_archive_page
  • posts_per_page
  • preview
  • robots
  • s
  • search
  • second
  • sentence
  • showposts
  • static
  • subpost
  • subpost_id
  • tag
  • tag__and
  • tag__in
  • tag__not_in
  • tag_id
  • tag_slug__and
  • tag_slug__in
  • taxonomy
  • tb
  • term
  • terms
  • theme
  • title
  • type
  • w
  • withcomments
  • withoutcomments
  • year
 If you think that this is not causing the issue, leave a comment and will help you out. WordPress is an interesting CMS and while developing themes and plugins you might come across several issues. We always recommend reading WordPress guide   . It covers guides for both Beginners and Intermediates.