Why is WordPress redirecting to homepage after GET form submit?

form method="get" action="example.com/?category=1"
    input type="submit"
/form

action parameter may be any page etc. but it always redirect to homepage. If I change method to POST - then all fine. What is the problem here?

Topic redirect forms Wordpress

Category Web


Try the following (untested):

  1. Change your permalink structure in your settings to Post Name.
  2. Try this action if used on a page: action="<?php the_permalink(); ?>"
  3. Or even try to remove the action altogether.

Your permalink structure appears to be incorrect try changing your code to. Modified, try creating a search form like this and see if you still get the homepage, if so then there will be something wrong with your theme templates.

<form method="get" action="/">
    <input type="text" name="s">
    <input type="submit">
</form>

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.