Why is POST’ing to my WP page template producing a 404?

WordPress listens to both $_GET and $_POST when parsing a request. If your form input names are conflicting with native query parameters, you’ll send WordPress on a wild goose chase (and most likely end up with a 404).

For your leisure, I’ve kindly listed them here – if any one of your form inputs uses these for a name, that’s the troublemaker.

Array
(
    [0] => m
    [1] => p
    [2] => posts
    [3] => w
    [4] => cat
    [5] => withcomments
    [6] => withoutcomments
    [7] => s
    [8] => search
    [9] => exact
    [10] => sentence
    [11] => debug
    [12] => calendar
    [13] => page
    [14] => paged
    [15] => more
    [16] => tb
    [17] => pb
    [18] => author
    [19] => order
    [20] => orderby
    [21] => year
    [22] => monthnum
    [23] => day
    [24] => hour
    [25] => minute
    [26] => second
    [27] => name
    [28] => category_name
    [29] => tag
    [30] => feed
    [31] => author_name
    [32] => static
    [33] => pagename
    [34] => page_id
    [35] => error
    [36] => comments_popup
    [37] => attachment
    [38] => attachment_id
    [39] => subpost
    [40] => subpost_id
    [41] => preview
    [42] => robots
    [43] => taxonomy
    [44] => term
    [45] => cpage
    [46] => post_type
)

Leave a Comment