Support » Fixing WordPress » Standard Search Not Working – Goes to front of blog!

  • I’ve got many 2.9.2 blogs all using the same theme and plugins, but on just one of my blogs the following odd problem is happening:

    Any search made from the standard WP Search widget will send the user to the front of the blog. -They could make the search from any page or post of the blog, it always navigates them to the front again.

    Archives and comments work great, so I tried replacing both the searchform.php and search.php files from another similar blog, but nothing changed at all.

    So odd… Anyone got any ideas? Here is my searchform code:

    <form method="get" name="searchform" action="<?php bloginfo('url'); ?>/">
    <div><input type="text" value="<?php the_search_query(); ?>" name="s" style="width: 95%;" />
    	<span class="art-button-wrapper">
    		<span class="l"> </span>
    		<span class="r"> </span>
    		<input class="art-button" type="submit" name="search" value="<?php _e('Search', 'kubrick'); ?>" />

    -It is working on many other similar blogs now… Just not this one.

    Thanks in advance,

Viewing 7 replies - 1 through 7 (of 7 total)
  • esmi


    Forum Moderator

    Have you tried:

    – deactivating all plugins to see if this resolves the problem? If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    – switching to the default theme to rule out any theme-specific problems?

    resetting the plugins folder by FTP or phpMyAdmin? Sometimes, an apparently inactive plugin can still cause problems.

    I’d tried the first two before with no success… Just tried the FTP fix now, still no good!

    As I said, it’s an odd one.

    What exactly does search.php need to use on a 2.9.2 build?



    Forum Moderator

    Nothing more than you’re already doing. The fact that a search kicks you back to the home page suggests that something is stripping out the search query.

    Does this site use the same server/host as the others?

    Hmm… I think it is on a different shared host… At the same place (Hostgator) – It should be exactly the same but honestly there isn’t another blog on this one exactly.

    What can I look for there? I know the PHP version would be the same…



    Forum Moderator

    It’s a long shot but it might be worth asking Hostgator if they can look into it.

    Thanks… I’ll give it a go.

    Do you run any plugins that modify the query, or do you have a custom set of arguments passed in query_posts on the index page, ie. your theme’s index.php.

    It’s perfectly normal for the search to send you to the home page, everything runs through the wordpress index.php ..

    A typical search URL would look like..

    Remove the search string and it’s the home page.

    Cases that would cause the search to just lob you back to the index with no query variables would be when you’re intercepting that query (plugin / custom function on pre_get_posts, etc…) or when you’re declaring the query parameters (running your own args through query_posts without preserving or merging the query variables would be one example).

    Switch theme, try the search, fixed? Open up which theme file usually deals with displaying the main page and see if there’s a query_posts line, if so, copy and paste it here.

    Not fixed switching theme? Disable plugins and try the search.

    Still not working? Try a search in the admin area (posts page is fine), do searches work there?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Standard Search Not Working – Goes to front of blog!’ is closed to new replies.