Search Light

WordPress „find as you type“ Dropdown

Aktuelle Version: 1.4.1

Search Light erweitert die Standard-Suche von WordPress um ein Ajax-Dropdown, in dem bereits während der Eingabe Suchergebnisse angezeigt werden. Die Suchergebnisse werden nach Artikeln und Seiten sortiert.

Vielen Dank an Marco Kuiper, der uns mit seiner Code-Demo zur Entwicklung dieses Plugins inspiriert hat.

Folgende Einstellungen können über die Administrationsoberfläche angepasst werden:

  • Theme-Auswahl
  • Anzahl der angezeigten Suchergebnisse
  • Anzeige von Seitenbildern
  • Position des Dropdowns
  • Bezeichnung der Überschriften innerhalb der Ergebnissanzeige
  • Eingabe individueller ID-Bezeichnungen für das Suchformular

44 Kommentare zu „Search Light“

  1. hiulit sagt:

    I think I just figured it out!!

    Go to „searchLight.php“ on line 185:

    $sql_where = “ WHERE “ . $sql_where;

    and just add:

    $sql_where = “ WHERE “ . $sql_where . “ AND ID IN (SELECT element_id FROM wp_icl_translations WHERE language_code = ‚$lang‘)“;

    Of course you have to specify the $lang, for that, just use:

    $lang = ICL_LANGUAGE_CODE;

    before the query.

    This has to be done too on line 200

    It seems to be working for me! 🙂

  2. hiulit sagt:

    Ok! I’ve found it! It was right in front of me! It actually stores it in „wp_posts“
    and then in „wp_icl_translations“, it takes the same ID and adds the „lang“ in some way..

    If I can help in any way making this great plugin work with WPML I’ll be happy to.

    Thanks again guys!

  3. hiulit sagt:

    Hi there!

    I find this plugin one of the best there are around! WOW!
    I really like it and it is what I wanted for my blog, thanks guys!

    There is a thing though. It would be really cool if it could work with WPML. I’ve seen that this issue it’s also been said by another user, but it was back in 2010!
    So I’m bringing it back.
    I tried to find out where does WPML store the translated posts in the MySQL database, but I could’nt find it.
    The only thing I can get it’s a hidden „lang“ variable

    Could you help me out? Thanks a lot! You’ve done an amazing job here!

  4. The reason that the plugin does not work on WP 3.0 or later is because 3.0+ does NOT have id=“searchform“ in the for the search widget.

  5. chummer sagt:

    Hallo, erstmal danke für dieses schöne Plugin. Es arbeitet auch in WP 3.1.1 gut.
    Wird es noch weiter Entwickelt? Oder könnte man mir helfen eine Suchoption einzubauen für die User?
    Ich benötige die Option, das der User auswählen kann, ob die Suche nur „Überschrift“ „Inhalt“ oder „beides“ durchsucht. Wäre das möglich?

  6. Josh sagt:

    Thanks for a great plugin guys.

    I’m finding it a bit slow in reaction time for search terms to appear, and I also notice that the search terms which show up aren’t highlighted on a: hover.

    Cheers for helping me add a cool option to my site.

  7. Hammer sagt:

    Search Light ist wirklich top! Aber… die Suche findet keine Tags, genau dass ist aber der Sinn der Sache wenn man Schlagwörter vergibt. Plugins wie „WP Search Tags“ oder „Search Everything“ funktionieren mit der normalen Suche aber nicht mit Search Light. Kann man da nicht ein Update machen, ist natürlich auch ein Donate wert.

  8. dgitaly sagt:

    Ciao from Italy, thank you for the plugin, very nice!

    One question: i have two search boxes on my blog, one in the header which i use with your nice plugin and a second one on the sidebar of the advance search page which uses the classic wp search box.

    Now what happens is that while with the wp search box results are found also amongst the post tags (and this is ok!), using your plugin post tags aren’t found (it seems your plugin excludes searching post tags). Any suggestions?

    Grazie and a presto, dina

  9. Pat sagt:

    Das Plugin funktioniert 1a auf der Webseite jedoch im Adminbereich von WordPress bekomme ich folgenden Fehler mit IE8 auf Windows 7:

    Meldung: ‚itsas_searchField.offset().top‘ ist Null oder kein Objekt
    Zeile: 15
    Zeichen: 2
    Code: 0

    Irgendjemand eine Idee?

  10. Don Schueler sagt:

    I love the look of this plugin but I can’t get it to work with the EVOLVE Theme. This is a free theme so is there the possibility that you can take a quick look for me. Thank you.

    Ich liebe den Look dieses Plugin, aber ich kann sie nicht mit dem EVOLVE Thema Arbeit. Dies ist ein freies Thema, so gibt es die Möglichkeit, dass Sie einen kurzen Blick auf mich nehmen kann. Danke.

    Here is the Theme:

  11. razvan sagt:

    An amazing plugin ! Thanks for sharing , it’s fantastic !

  12. chris sagt:

    Just installed the plugin but it doesn’t work. I tried changing the ID from „s“ to „searchbox“ but still nothing.
    this is my site


  13. maya sagt:

    i just installed your plugin and it works great!
    however, i skimmed through the php code and saw that when building the sql query you directly use the un-escaped query string. unless i missed something this could potentially be used for sql injection.

    just to make sure – i changed the function itsas_sqlWhere to explicitly escape the ’search_key‘ argument. i simply added
    $search_key = mysql_real_escape_string($search_key);
    right inside the first if statement.

    sorry for writing this here, couldn’t find your contact info, feel free to erase


  14. Ayoosh Kathruria sagt:

    Hey i love ur plugin, but since i use the awake theme from webtreats and using it makes the text displayed in the search-results panel are not visible. it luks awful when no results !! is it a type of function im missing or something. im willing to send my files if u can help me !! please help me i rele wanna use this plugin!!!

  15. Xzibitz sagt:

    Really like this plugin guys.

    I’ve modified a few things in it for myself. I have added a custom post type search (unfortunately, I’m not that good at coding, so I just did it for MY custom post types, I don’t know of a way to make it easy for anyone else by just using a settings page) and I have modified the ajax.js so that it doesn’t start until at least 3 characters have been put in and there is also a small delay to accommodate for people typing a little slower (and thus not crawl the whole database after every single character they put in).

    For anyone who wants this last change, open up the ajax.js file and go to line 94. Change the „1“ to the amount of characters you like as a minimum.
    Comment line 95 by putting two frontslashes before it „//“
    Remove the frontslashes from line 96, change the value to anything you like as delay (in miliseconds I believe, so the 220 that is there at the moment stands for 0.22sec)

    Anyway, that’s a little how-to, but I’d rather like to know if we’re going to have these features in a next release:
    – set minimum characters allowed
    – set a delay
    – display custom post type(s)

    • Xzibitz sagt:

      Oh, and there’s also a bit of hardcoded German in the ajax.js file at the top. These two things (Seiten and Artikel) will show up for a very brief but noticeable moment in the dropdown. Would be nice if these are deleted.

    • dkowalski sagt:


      thanks for your feedback, I just added your feature requests to my list.



  16. Erik sagt:


    I have a problem with the plug-in on my site. When I installed it, all worked just fine. I think it was when I updated to WP 3.0 the problem occured. The drop-down from the searchbox is gone!

    Can someone take a look?

    Thanks! 🙂 And, btw, great plug-in!

    • dkowalski sagt:


      I just had a quick look at your site, everything seems to be fine.
      As soon as I type into the search box, the dropdown appears.

      Maybe it’s a browser or cache-problem? Try clearing your cache
      and completely close the browser.



    • mark sagt:

      Hi Antworten,

      I just installed the search plug in. I like it, but is an English version available or can I edit it myself?


      • dkowalski sagt:


        just go into Settings > Search Light of your WordPress installation.
        Under Translation you can change the text that shows up in the dropdown.



  17. Kees van heijden sagt:


    Can this plugin be used in conjuction with WPML?

    So you will only be searching in the English text or only in the German for example.



    • dkowalski sagt:


      the current version is not able to do this.

      Since we haven’t used WPML for our projects,
      I first would have to research how the language
      separation is done within the database.

      The latest release of Search Light is able to hide certain
      posts from the result list, I would need to get back to our
      coder to see if we can somehow adapt this feature to
      dynamically hide all results from the currently not selected

      I will put it on my feature wish list.



  18. Mary sagt:

    … I hope I can figure out how to use this it’s Beautiful!!!

    • dkowalski sagt:

      Glad you like it!

      please let me know if you need any further
      assistance on how to make it work in your site.

      In most cases, as I wrote in my last comment,
      you just need to activate the plugin to start using it.

      When it is not showing up after you start typing in the
      searchbox, there could be a problem with the ID of the
      searchform or the input-field. These need in some cases
      to be updated in the advanced settings of Search Light.

  19. Mary sagt:

    Guten Tag! I am in San Francisco! Sorry to be such a „Newbie“ i love the idea of this plugin. Do I insert an HTML code to get it to show up in my HTML code editor? I want to insert the search in a particular page???

    • dkowalski sagt:


      there’s no need to manually add the plugin to you HTML code.
      After installing and activating the plugin, it should automatically show
      up wherever the default WordPress search is located in the theme you are

      Greetings from Germany!


  20. Bob James sagt:

    Hello. Please email me when this plugin gets upated for WordPress 3.0.

    I spent the afternoon trying to get it to work and then noticed it was only good up to version 2.9.2

    Someday I will learn to read release notes!

    • dkowalski sagt:


      I just did an upgrade of a test-installation from 2.9.2 to 3.0 without any problems:

      So the plugin seems to run just fine under 3.0.

      Did it work before you made the upgrade to 3.0?
      Have you changed the theme for your site?
      If you changed the theme, this could be your problem.

  21. Thank you very much for this great plug-in. It is exactly that what I was looking for: a separation of pages and posts in the results. The only thing I am missing is that the search phrase should be highlighted in the pages/post I choose of your drop-down menu. It this an easy task to do?

    Cheers to Heidelberg from Wächtersbach, gl

    PS: I would appreciate an answer to

  22. Sascha sagt:

    Ich habe das problem mit einer Seite meines Bekannten auch. In dem mit Artisteer erstellten Theme funktioniert das Suchplugin nicht. Wie kann ich das anpassen damit es funktioniert? 🙂

  23. Darren sagt:


    This is a fantastic plugin, thank you!

    Is there a way to exclude pages from showing up in the list?

    Thanks, Darren.

    • dkowalski sagt:


      glad you like it!

      In the current release there’s no easy way to do this, but it’s already on my list of features we will add to a future version.

      There you’ll have a new option to exclude certain posts or pages in the result-panel.

  24. Pls check out and tell me why it’s not workin ?? it works on most of my other blogs. Thanks

    • dkowalski sagt:


      please try the following:
      In WordPress admin, go to „Settings“ > „Search Light“.
      Under „Advanced“ you will find the option to change the „Input-field ID“.
      As a default, it is set to „s“. Change this to „searchbox“ and click „Save changes“.

  25. Chris sagt:


    ich habe das Suggestion Search Plugin Search Light bei unserem WP-Blog installiert, jedoch funktioniert das Plug-In nicht, das Plugin ist aktiviert aber die Suche bleibt völlig unverändert und es erscheint auch keine Fehlermeldung.

    Woran könnte das liegen? Dankeschön 🙂

    • dkowalski sagt:


      es könnte ev. am verwendeten Theme liegen. Am besten in einer Test-Installation der Site das Theme auf den WordPress Standard „WordPress Default 1.6 von Michael Heilemann“ setzen und hier das Suchfeld testen.

      Wenn Search Light sauber funktioniert, liegt es am PHP-Code für das Formular im Greenway-3C Theme.

  26. Ted sagt:

    Hi there man… nice work!
    Could you help me with the fact that when i do a search it don´t show any picture?


    • dkowalski sagt:


      since I don’t know if the WordPress theme you are using is already supporting Post-Thumbnail Images, it’s hard to analyze your problem. If you could give me an URL to your site, I will have a look.

  27. Anonymous sagt:

    un plugin ajax pour une recherche assistée via la barre de recherche déjà existante du site.