Continue reading Free 2.9.13, Premium 1.7.6

Free 2.9.13, Premium 1.7.6

Small maintenance updates to both free and Premium, mostly with the same changes. Here’s what’s new in both: Fixed a mistake in the FAQ: correct post date parameter is ‘post_date’, not ‘date’. New filter relevanssi_results added. This filter will process an array with (post->ID => document weight) pairs. Private and draft posts were deleted from…

Read more Free 2.9.13, Premium 1.7.6 0 Comment on Free 2.9.13, Premium 1.7.6
Continue reading Most important Relevanssi debugging trick

Most important Relevanssi debugging trick

When you have problems with Relevanssi, these are the first steps to take: Make sure you have the latest version of Relevanssi. If not, upgrade. Try deactivating the plugin and reactivating it. Are you using Yoast Local SEO? Read this. Try deleting the plugin and reinstalling it from scratch. If that doesn’t help, then approximately…

Read more Most important Relevanssi debugging trick 271 Comments on Most important Relevanssi debugging trick
Continue reading Setting post_type to page doesn’t work

Setting post_type to page doesn’t work

For some reason setting the post_type query variable to page doesn’t have the desired effect. Other post types (post, custom post types) work, but page doesn’t do anything. This is not a Relevanssi bug, but a WordPress feature (see this trac ticket). If the user inputs a bad value to……the post_type query variable, WordPress changes it to any. For some reason that happens also when the post_type is set to page, even though that should be a valid value. There’s nothing Relevanssi can do about this. However, there’s a fix. Relevanssi introduces a new query variable post_types, which happily…

Read more Setting post_type to page doesn’t work 0 Comment on Setting post_type to page doesn’t work
Continue reading Premium 1.7.5

Premium 1.7.5

I was told that Relevanssi Premium doesn’t index drafts, even though it should (since 1.6). Looks like the feature has gone missing in some update. Sorry about that. This version reintroduces it. Drafts are automatically indexed and shown in admin searches. I’m also adding the first test version of the declension featured mentioned before. This…

Read more Premium 1.7.5 2 Comments on Premium 1.7.5
Continue reading Filtering results by category

Filtering results by category

…you want to. Remember that whenever you link to search results like that, it’s a good idea to tell Google and other bots to avoid indexing the results. The link above has the “rel=’nofollow’” instruction, but you can also use robots.txt to prevent bots from spidering your search results pages….In order to filter search results by category, use the following code: $url = get_bloginfo(‘url’); $url = esc_attr(add_query_arg(array(‘cat’ => ’10’, ‘s’ => get_search_query()), $url)); echo “Filter by category 10”; Put this in your search results template. What the code does is to create a link that takes the current search……query and adds the category variable to it. This link filters the results by category 10, change the number to correct category ID to make it filter by the category you want to. Remember that whenever you link to search results like that, it’s a good idea to tell Google…

Read more Filtering results by category 27 Comments on Filtering results by category
Continue reading Related searches feature

Related searches feature

John Blackbourn wrote a cool related searches feature for Relevanssi Premium. It’s included from version 1.7.4. In order to use the related searches, you must have search logging enabled and a good log of past searches. Then add the following code to your search results template in a suitable place:……if ( function_exists( ‘relevanssi_related’ ) ) { relevanssi_related( get_search_query(), ‘<h3>Related Searches:</h3><ul><li>’, ‘</li><li>’, ‘</li></ul>’, 5 ); } The first parameter is the search query and the last parameter is the number of searches to show. The rest are about the display. The function looks at the search log and returns queries……which have at least one matching token with the current search. Searching for “john” will match both “john blackbourn” and “john smith”. Searching for “john blackbourn” will match “john smith”, but won’t match “john”, because the function doesn’t suggest queries that consist of only one token. Also, only queries that…

Read more Related searches feature 21 Comments on Related searches feature
Continue reading Premium 1.7.3

Premium 1.7.3

Lots of bug fixes and couple of neat new features in this version. Cache truncation was never actually scheduled. Index wasn’t updated properly when post status was switched from public to private. Made the relevanssi_hide_post custom field invisible. Added an option to hide the Relevanssi post controls metabox on edit pages. Fixed a bug that…

Read more Premium 1.7.3 9 Comments on Premium 1.7.3