WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Relevanssi - A Better Search

Relevanssi replaces the default search with a partial-match search that sorts results by relevance. It also indexes comments and shortcode content.

  1. Extract all files from the ZIP file, and then upload the plugin's folder to /wp-content/plugins/.
  2. If your blog is in English, skip to the next step. If your blog is in other language, rename the file stopwords in the plugin directory as something else or remove it. If there is stopwords.yourlanguage, rename it to stopwords.
  3. Activate the plugin through the 'Plugins' menu in WordPress.
  4. Go to the plugin settings and build the index following the instructions there.

To update your installation, simply overwrite the old files with the new, activate the new version and if the new version has changes in the indexing, rebuild the index.

Note on updates

If it seems the plugin doesn't work after an update, the first thing to try is deactivating and reactivating the plugin. If there are changes in the database structure, those changes do not happen without a deactivation, for some reason.

Changes to templates

None necessary! Relevanssi uses the standard search form and doesn't usually need any changes in the search results template.

If the search does not bring any results, your theme probably has a query_posts() call in the search results template. That throws Relevanssi off. For more information, see The most important Relevanssi debugging trick.

How to index

Check the options to make sure they're to your liking, then click "Save indexing options and build the index". If everything's fine, you'll see the Relevanssi options screen again with a message "Indexing successful!"

If something fails, usually the result is a blank screen. The most common problem is a timeout: server ran out of time while indexing. The solution to that is simple: just return to Relevanssi screen (do not just try to reload the blank page) and click "Continue indexing". Indexing will continue. Most databases will get indexed in just few clicks of "Continue indexing". You can follow the process in the "State of the Index": if the amount of documents is growing, the indexing is moving along.

If the indexing gets stuck, something's wrong. I've had trouble with some plugins, for example Flowplayer video player stopped indexing. I had to disable the plugin, index and then activate the plugin again. Try disabling plugins, especially those that use shortcodes, to see if that helps. Relevanssi shows the highest post ID in the index - start troubleshooting from the post or page with the next highest ID. Server error logs may be useful, too.

Using custom search results

If you want to use the custom search results, make sure your search results template uses the_excerpt() to display the entries, because the plugin creates the custom snippet by replacing the post excerpt.

If you're using a plugin that affects excerpts (like Advanced Excerpt), you may run into some problems. For those cases, I've included the function relevanssi_the_excerpt(), which you can use instead of the_excerpt(). It prints out the excerpt, but doesn't apply wp_trim_excerpt() filters (it does apply the_content(), the_excerpt(), and get_the_excerpt() filters).

To avoid trouble, use the function like this:

<?php if (function_exists('relevanssi_the_excerpt')) { relevanssi_the_excerpt(); }; ?>

See Frequently Asked Questions for more instructions on what you can do with Relevanssi.

The advanced hacker option

If you're doing something unusual with your search and Relevanssi doesn't work, try using relevanssi_do_query(). See Knowledge Base.

Uninstalling

To uninstall the plugin remove the plugin using the normal WordPress plugin management tools (from the Plugins page, first Deactivate, then Delete). If you remove the plugin files manually, the database tables and options will remain.

Combining with other plugins

Relevanssi doesn't work with plugins that rely on standard WP search. Those plugins want to access the MySQL queries, for example. That won't do with Relevanssi. Search Light, for example, won't work with Relevanssi.

Some plugins cause problems when indexing documents. These are generally plugins that use shortcodes to do something somewhat complicated. One such plugin is MapPress Easy Google Maps. When indexing, you'll get a white screen. To fix the problem, disable either the offending plugin or shortcode expansion in Relevanssi while indexing. After indexing, you can activate the plugin again.

Requires: 3.3 or higher
Compatible up to: 3.9-beta
Last Updated: 2014-4-8
Downloads: 557,737

Ratings

4 stars
4.5 out of 5 stars

Support

36 of 58 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

2 people say it works.
0 people say it's broken.

100,1,1
50,4,2
100,1,1
50,4,2 100,2,2 100,1,1
100,2,2 100,1,1 100,6,6 80,5,4 100,1,1 0,1,0 100,1,1 100,1,1
75,4,3 100,3,3 100,3,3 0,1,0
100,2,2 100,1,1 50,2,1 100,1,1 100,4,4 67,3,2 100,3,3 60,5,3
100,1,1
100,3,3 100,1,1
100,2,2 100,1,1 100,1,1
100,1,1 100,1,1 100,3,3
100,1,1 100,1,1 100,1,1 100,1,1 100,10,10 63,8,5 100,1,1
100,3,3 50,2,1 100,2,2
100,7,7 100,1,1 67,3,2 100,1,1
100,3,3 100,4,4 100,1,1 0,12,0 100,2,2
0,1,0
100,1,1 100,1,1 0,1,0 100,2,2
83,6,5 100,9,9 90,10,9 100,3,3 100,3,3 100,1,1 100,3,3 100,9,9 100,1,1
67,6,4 100,1,1
100,1,1 100,1,1 89,9,8 100,4,4 100,12,12
57,7,4 0,1,0 100,1,1
0,1,0 100,1,1
100,2,2 27,11,3 50,8,4 60,5,3 100,5,5 40,5,2
100,1,1 85,20,17 100,1,1
0,1,0 0,3,0 100,1,1 50,2,1 83,6,5 100,1,1
100,1,1 50,2,1 71,7,5 100,8,8 56,9,5 100,1,1
100,1,1
50,2,1 33,3,1
67,6,4
20,5,1 67,3,2
100,3,3
50,2,1
67,3,2 0,1,0 0,2,0 100,1,1 67,3,2 100,2,2
100,2,2
100,3,3
83,6,5
100,2,2