WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I built a custom theme, and in it, there is a 404.php page and a search.php page.

Elsewhere in the template, I wanted to link to the search page directly. So, I used the get_search_template() function to get the search page link, which results in a link like this: http://example.org/search

When I click the link, I get sent to the 404 page template.

Why is it going to the 404 page template instead of the search page template?

share|improve this question
up vote 1 down vote accepted

Confusingly WordPress does not have a concept of a simply search page, it only has concept of search results page. The difference is critical because search without search query 404s as you are seeing.

If you want dedicated search page you would have to implement it as custom one, see Codex > Creating a Search Page.

share|improve this answer
Those instructions are for wordpress 2.5 and don't work with 3.5.1. – Force Flow Apr 30 '13 at 19:02
Elaborate by updating your question or asking new one? It might be outdated in details, but it seems fine to me conceptually. – Rarst Apr 30 '13 at 19:07
Details matter ;) Anyway, I was able to figure it out. The template page needs to be named page-search.php. A page named "Search" must be created in the wordpress dashboard. – Force Flow Apr 30 '13 at 19:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.