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:
- WordPress 2.7 or above
Installing
- Download Better Search.
- Extract the contents of
better-search.ziptowp-content/plugins/folder. You should get a folder calledbetter-search. - Activate the Plugin in WP-Admin.
- Goto Options > Better Search to configure.
- 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.
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:
- 1.1.7 – Added two new fulltext indexes -
64 Comments
Leave a commentTrackbacks and Pingbacks
- New WordPress Plugin: Better Search | Weblog Tools Collection
- Contextually search with Better Search WordPress plugin
- New WordPress Plugin: Better Search | Ajay - On the Road called Life
- Better Search v1.1 released | Ajay - On the Road called Life
- WordPress Plugin Releases for 03/23 | Weblog Tools Collection
- WordPress Plugin: Better Search | Blogging Pro
- Migliorare le ricerche in Wordpress | Napolux.com
- Melhore os resultados de busca do WordPress | pBlog
- Entradas en las blogosferas.115, Carrero
- WordPress Plugin: Better Search | zooped.org
- WordPress Plugin Releases for 03/26 | Weblog Tools Collection
- Improving WordPress Search : Update | Artiss.co.uk
- WordPress Plugin Releases for 04/02 | Weblog Tools Collection
- Weblog Tools Collection: WordPress Plugin Releases for 05/05 « Internet Turnkey Websites
- Better Search bug-fix release | Ajay - On the Road called Life
- WordPress Plugin Releases for 06/13 | Weblog Tools Collection





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
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.
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.
WIP
I think I’ll get down to this ASAP.
I’m not using widgets in my site, my sidebars are hard coded. How would I use this plugin?
Check out the Options section at the top. There’s code on manually displaying the heatmaps
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?
What version of mySQL are you running? Can you take this to the forum as there may be some debugging to do.
Me too – my ISP uses MySQL version 5.0.32
Sure thing.
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.
Thanks for reporting this. I have already coded it in. Will release this with the new version.
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.
I’m confused by what you mean by missing the and & tags?
I edited my post but the html, head and body HTML tags are missing from the search results page.
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.
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).
Thanks for pointing this out. I’ll put in the option to exclude private posts in the next version.
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.
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?
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!
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.
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.
The option is in place with v1.1
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
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.
It seems like search results show [shortcode] used in posts. Maybe they should be filtered out when not rendered ?
John Myrstad
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.
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.
I have been modifying the plugin, particularly the
foreachloop which displays all the posts, so it mimics as if it was inthe_loop.This makes it much easier to work with as wordpress then has several functions available for displaying the posts.
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
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
Thanks Jan. I’ll implement these changes after my tests into the next version of WP.
Also internationalize the same accordingly.
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
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
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.
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.
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
You can easily do that by creating a template file for your theme. Check the link above.
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
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
The Total Popular Searches and Daily Searches are two different widgets / functions.
Hi,
And how do I enable only Total Popular Searches?
Thanks
http://ajaydsouza.com/wordpress/plugins/better-search/#installing
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.
Can I exclude pages and search posts only?
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?
Hello Ajay,
It says i need to add the code
I don’t know where? Is it at the function.php?