Skip to content

Better Search

Overview:

Do you hate the inbuilt WordPress search?

Improve your visitors search experience with Better Search. Better Search will provide contextually search your WordPress blogs and then list the results based on relevance. By using a template file you can completely control the look and feel of the search results page.

Additionally, the plugin will track the searches and allow you present a “search heatmap” of the most popular searches.

Features:

  • Search for posts contextually with results sorted by relevance
  • Automatically replaces your default WordPress search with Better Search results
  • Display a list of popular search terms (daily and overall) on your blog in the form of a heatmap
  • Choose between WordPress search and Better Search (coming soon)
  • Support for templates for complete customization of look and feel of search results page
  • Clean uninstall if you choose to delete the plugin from within WP-Admin
  • Works with caching plugins like WP-Super-Cache

Requirements:

Installing

  1. Download Better Search.
  2. Extract the contents of better-search.zip to wp-content/plugins/ folder. You should get a folder called better-search.
  3. Activate the Plugin in WP-Admin.
  4. Goto Options > Better Search to configure.
  5. Goto Appearance > Widgets to add the Popular Searches sidebar widgets to your theme

Options:

Below is the options screen as you would see it when you activate the plugin.

Better Search Options

In order to display the most popular searches, you will need to add <?php if(function_exists('the_pop_searches')) the_pop_searches(); ?>.

In order to display the most popular searches weekly/daily, you will need to add <?php if(function_exists('the_pop_searches_daily')) the_pop_searches_daily(); ?>.

Alternatively, use the sidebar widgets to display the overall or weekly top searches.

By default the plugin adds powered by link to this page. You can choose to uncheck that above. However, it would be great if you could give me some link love and help promote this completely free plugin.

ChangeLog:

64 Comments

Leave a comment
  1. Ray / Mar 21 2009

    Hi there,

    Looks very promising. Is it possible to have it take on the existing Theme Style? How does one change the ‘style’ of the search results page?

    Regards,

    Ray

    • Ajay / Mar 21 2009

      The plugin uses the .bsearch_results_page class for displaying the results. However, for major changes you need to edit the plugin :(
      I’m working on a release that will allow you to use a template page in your theme for this purpose.

  2. Eric Koch Photo / Mar 21 2009

    It would save some headaches if the plug-in used the theme’s main page template instead of creating its own and hoping that just calling the header and footer will work.

    • Ajay / Mar 21 2009

      WIP :)

      I think I’ll get down to this ASAP.

  3. Kathy / Mar 21 2009

    I’m not using widgets in my site, my sidebars are hard coded. How would I use this plugin?

    • Ajay / Mar 21 2009

      Check out the Options section at the top. There’s code on manually displaying the heatmaps

  4. Todd / Mar 22 2009

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), INTERVAL 1 DAY)' at line 1]
    SELECT DATE_ADD(DATE_SUB(CURDATE(), INTERVAL DAY), INTERVAL 1 DAY)

    This is the error I get when I have both Popular and Weekly Popular Search widgets turned on and in the sidebar. Do, or should I give time for the weekly searches to populate? Is this why I am getting this error?

    • Ajay / Mar 22 2009

      What version of mySQL are you running? Can you take this to the forum as there may be some debugging to do.

  5. amal graafstra / Mar 22 2009

    it would be great if the search did not include drafts in the results. i have a ton of posts i’m working on at any given time and they all show up in the search results.

    • Ajay / Mar 22 2009

      Thanks for reporting this. I have already coded it in. Will release this with the new version.

  6. Eric / Mar 22 2009

    The results of my search are much better now! Thanks for that! :)

    The search results page is missing the <html>, <head> & <body>tags.

    Would love to see theme integration.

    • Ajay / Mar 22 2009

      I’m confused by what you mean by missing the and & tags?

      • Eric / Mar 23 2009

        I edited my post but the html, head and body HTML tags are missing from the search results page.

  7. Steve / Mar 23 2009

    Looks great Ajay, thanks. Going to give it a spin today.

    One feature I’d suggest is the ability to exclude certain pages or posts via the admin interface. This is really useful when you don’t want certain content to be found by users via site search.

  8. Gerhard / Mar 23 2009

    Very nice, but I have deactivated it. Hidden posts (set as “private”) are appearing as shortform in the results for everyone.
    This should only appear when logged in as admin (like in original WP-search).

    • Ajay / Mar 23 2009

      Thanks for pointing this out. I’ll put in the option to exclude private posts in the next version.

      • Gerhard / Mar 24 2009

        Hi Ajay, the exclusion of private posts/pages (and drafts) should be set by default.
        the options may sound like this: “include drafts in search?” and a separated question: “include private posts in search?”.
        the same options with pages.

        • Ajay / Mar 24 2009

          Drafts are completed excluded in v1.1.

          I actually didn’t consider private posts, I’ll put that in the next version.

          BTW, when you say private posts, you mean those password protected right?

          • Gerhard / Mar 24 2009

            In the menu for “publishing” an article or page after writing, there are three options: 1. public / 2. password protected / 3. private.
            The “private” postas/pages only might be seen from “logged in” users (admin, authors). Equaly it should be with the search results. The pass-protected posts/pages should be included in search, but only with the headlines and without shorttext (like in WP-original search). The “private” content have to be hidden from public users to keep privacy.
            This was sayed independantly from the options for inclusions/exclusions, you will give in future versions of “better search”. Many greetings from Austria!

          • Gerhard / Mar 24 2009

            If there are some open questions, it might depend on plugins, I am using for options with “private” content and handling of “pages” in search (and RSS): “Is Subpage Of”, “RSS Includes Pages” or others.

  9. abdullah / Mar 23 2009

    Hey,

    This is quite an interesting and unique plugin.
    Can you include an option to turn off “popular search” and an option to exclude pages (i.e. only search in posts, not pages)?

    Thanks.

    • Ajay / Mar 24 2009

      The option is in place with v1.1

  10. John Myrstad / Mar 25 2009

    Nice plugin.

    I`d like to request an enhancement. The relevance score isnt intuitive for users and i`d like to see an option to choose other ways of showing relevance like %, stars or anything else that`s more intuitive to understand.

    Relevance Score: 5.153

    Is that much or little ? Whats max ?

    Relevance Score: 75% is much easier to understand.

    John Myrstad

    • Ajay / Mar 25 2009

      I’m been thinking the same thing as well. I’ll need to study this a bit better. Alternatively, I’ll try a “relative” percentage basis for calculation.

  11. John Myrstad / Mar 25 2009

    It seems like search results show [shortcode] used in posts. Maybe they should be filtered out when not rendered ?

    John Myrstad

  12. Jan Jaap / Mar 25 2009

    Really like this plugin and giving it a test-drive on my local installation. Search results are way better then the defaults, however there are some points which would be nice if implemented.

    The layout of the search results (table | posts | footer) are still generated in the code. Would be nice if there could be some kind of callback feature where you can replace the output of a post with your own HTML, now you have to hardcode it in the plugin.

    • Ajay / Mar 25 2009

      This is actually a top priority list. Instead of a call back function, I plan on implementing Template Tags (or support for WordPress inbuilt Template Tags). I believe this is a lot easier to implement and understand for users.

      • Jan Jaap / Mar 25 2009

        I have been modifying the plugin, particularly the foreach loop which displays all the posts, so it mimics as if it was in the_loop.

        This makes it much easier to work with as wordpress then has several functions available for displaying the posts.

        • Tom / Mar 31 2009

          Hi Jan Jaap and Ajay,
          Jan Jaap, could you share your code with us? I’m very interested in how you did this! Maybe it is also a solution for the question by John Myrstad. I’m also stuck with the [shortcodes] issues.
          It looks to me that the_excerpt() handles those codes quite well by eliminating them, which is better than, well, showing the codes themselves :-)

          TIA,

          regards,

          Tom

          • Jan Jaap / Apr 1 2009

            Tom,

            I modified the better-search.php file, adding several variables so that it is tricking wordpress that it is in ‘the_loop’.

            My better-search.php file

        • Ajay / Apr 1 2009

          Thanks Jan. I’ll implement these changes after my tests into the next version of WP.

          Also internationalize the same accordingly.

        • Tom / Apr 7 2009

          Thanx a million Jan Jaap and Ajay! I notice your alterations have some Dutch phrases… geen probleem! / no problem! :-) I’ll go check them out!

          Tom

        • Tom / Apr 8 2009

          Hi,

          just implemented the plugin, with the alterations of Jan Jaap. It is in fact (I think) the solution to the question of John. At least it does the trick for me!

          One comment though: it is a bit unclear to me how the relevance is calculated. Sometimes when I perform a search, I’d expect some results coming up before others. But fair enough, I think it is way better than the original WP-search. Thanx again, Ajay for your good work, and Jan Jaap for your adjustments!

          Regards,

          Tom

          • Ajay / Apr 8 2009

            The relevance is a calculated by mySQL by matching the term with your content.

            I’ll be putting in Jan’s implementation the moment I find the time to update.

      • Jan Jaap / Apr 9 2009

        I have been modifying and stripping down this modification even further until I came up with the following version for my own website.

        Stripped version of better search

        Basicly what I did is use the filter functions of wordpress and replace the query for fetching the search posts with the one used in better-search plugin.

        Then if you are in the search.php file of your template you can still access the search score via $post->score.

        So again I want to thank you for releasing this great plugin as it improves search results quite a lot.

  13. Elliott / Mar 30 2009

    Hi,

    Nice plugin.

    My suggestion would be a way of turning off popular search/hot searches so that only the contextual search appears if that makes sense.

    Elliott

    • Ajay / Mar 30 2009

      You can easily do that by creating a template file for your theme. Check the link above.

  14. Kirk / Apr 6 2009

    Hi, thanks for a great plugin.
    Is there any way to limit the summary length in the search results, or eliminate the summary completely? Other options would be to display tags and categories, but these are somewhat addressed in comments above.
    Cheers

  15. Daniel / Apr 10 2009

    First congratulations for this great plugin.

    Just a request. Can you create an option to enable/disable showing the daily/week/popular searches ?

    Because, I wanted to just show the Popular searches and was a war to do it :-) . I am almost sure that I messed up with the code. :-)

    Anyhow, thanks for this plugin.

    Best,
    Daniel

  16. Leo Lemos / Apr 14 2009

    Hi, great plugin! Congrats!

    I have a question, how I hide contact form (contact form 7- famous plugin) codes from search results?
    Ex: [contact-form 1 "contact"]

    Thanks.

  17. levani / May 1 2009

    Can I exclude pages and search posts only?

  18. Tompa / May 19 2009

    Thanks for a great plugin.

    I have one problem though and that is that I have a “members area” which “hides” some pages for unregistered, using User access manager (http://www.gm-alex.de/projects/wordpress/plugins/user-access-manager/).
    The “member” pages comes up in the search results, which is not good.
    Is there something I can do to exclude “member pages” in the search results?

  19. Dex / Jun 13 2009

    Hello Ajay,
    It says i need to add the code

    I don’t know where? Is it at the function.php?

Trackbacks and Pingbacks

  1. New WordPress Plugin: Better Search | Weblog Tools Collection
  2. Contextually search with Better Search WordPress plugin
  3. New WordPress Plugin: Better Search | Ajay - On the Road called Life
  4. Better Search v1.1 released | Ajay - On the Road called Life
  5. WordPress Plugin Releases for 03/23 | Weblog Tools Collection
  6. WordPress Plugin: Better Search | Blogging Pro
  7. Migliorare le ricerche in Wordpress | Napolux.com
  8. Melhore os resultados de busca do WordPress | pBlog
  9. Entradas en las blogosferas.115, Carrero
  10. WordPress Plugin: Better Search | zooped.org
  11. WordPress Plugin Releases for 03/26 | Weblog Tools Collection
  12. Improving WordPress Search : Update | Artiss.co.uk
  13. WordPress Plugin Releases for 04/02 | Weblog Tools Collection
  14. Weblog Tools Collection: WordPress Plugin Releases for 05/05 « Internet Turnkey Websites
  15. Better Search bug-fix release | Ajay - On the Road called Life
  16. WordPress Plugin Releases for 06/13 | Weblog Tools Collection

Leave a comment