I am trying to create a simple form on one of my wordpress pages. The code used is as basic as it can be, namely the following:

<form action="" method="GET">
            <option value="test" >test</option>

        <input type="submit" value="search">

the problem is, every time i click the search button, i get redirected to the homepage! Shouldn't this small little form be redirected to the page containing the form, since action is empty?

  • The URL you see in the address bar is the homepage URL?
    – Milo
    Sep 9, 2017 at 14:50
  • yes, it was the homepage url, even though that is not where the form originates.
    – user127554
    Sep 10, 2017 at 13:55

2 Answers 2



<form action="#" method="GET">

(Although I prefer the POST method.)

  • i need those variables to be visible so it makes (in my opinion) for a nicer looking url.
    – user127554
    Sep 10, 2017 at 13:55

Alright guys, believe it or not, but the underlying problem had to do with permissions on the root folder!

the aforementioned <form action="#" method="GET"> didn't work either, so i digged a little deeper, and i found out certain pages couldn't be opened either.

Why this causes every single simple form to be redirected to home is beyond me, but the solution was to change the permissions of the .htaccess file (which WAS present by the way), to 775.

Out of caution i also changed the root folder permission to 775, and all is well now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.