Support » Fixing WordPress » search box opens Facebook instead of searching

  • Carma


    The search box on my blog works fine in IE. But in Chrome and Firefox, when I click in the search box, it makes a new Facebook window pop open. There is no way to use the search box at all. I have deleted and reinstalled it but it continues to open Facebook!

    My website is

Viewing 2 replies - 1 through 2 (of 2 total)
  • michael.mariart


    This is happening because Chrome and FireFox are behaving as they are meant to from your HTML code. IE is the “od one out” becuase it’s not following standards.

    The code for your search form is:

    <form id="searchform" class="searchform" method="get" action=""><a target="_blank" href="">
        <p class="clearfix default_searchform">
            <input type="text" name="s" onblur="if (this.value == '') {this.value = 'Search';}" onfocus="if (this.value == 'Search') {this.value = '';}" value="Search">
            <button type="submit"><span>Search</span></button>

    I’m not sure how obvious it is, so I’ll point it out. You have a link wrapping your entire search area – <a target="_blank" href="">. Because it’s a link, when someone clicks on it (anywhere inside that search area) they will go to that link.

    Without knowing your system I’d say that this is written into the theme, and is most likely in a file called search-form.php. If you can edit that file you will be able to remove the link tag. Jut be sure to remove the closing </a> tag as well.

    THANK YOU! This wasn’t exactly the problem but you put me on the right track! I checked my search-form.php (and everything to do with search) and they all looked correct, without the link to the Facebook page. Finally I looked in the widget above the search box widget, the one that was actually supposed to have the link to my Facebook page … and there it was, after all my correct coding: an extra link to the Facebook page without a closing tag!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘search box opens Facebook instead of searching’ is closed to new replies.