Continue reading How to include specific posts

How to include specific posts

Hello, I’m using WooCommerce and Relevanssi and they work great. My Site Search only searches Products, however I want to let certain posts appear in the search results. Is there a way to allow certain posts to be in the results? Yes. There are many ways to do this, and the best way depends on…

Read more How to include specific posts 2 Comments on How to include specific posts
Continue reading Search results in random order

Search results in random order

Do you want to order your search results in random order? Here’s how: Add this function to your site and the search results will appear in random order. You can also do this: However, both of these solutions only work if all the search results are on the same page. If the results span multiple…

Read more Search results in random order 1 Comment on Search results in random order
Continue reading Adjusting search throttle

Adjusting search throttle

If Relevanssi Premium causes out-of-memory problems, make sure you have the “Throttle searches” option checked. However, if that doesn’t work and you’re still getting out of memory issues, you can try making the throttle tighter. The limit can be adjusted by adding this line to your site: If necessary, you can adjust the value (250)…

Read more Adjusting search throttle 7 Comments on Adjusting search throttle
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…

Read more Setting post_type to page doesn’t work 0 Comment on Setting post_type to page doesn’t work
Continue reading Filtering results by category

Filtering results by category

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 "<a href=’$url’ rel=’nofollow’>Filter by category 10</a>";$url = get_bloginfo(‘url’); $url = esc_attr(add_query_arg(array(‘cat’ => ’10’, ‘s’ => get_search_query()), $url)); echo "<a href=’$url’ rel=’nofollow’>Filter by category 10</a>"; Put this in your search results…

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: The first parameter is the…

Read more Related searches feature 21 Comments on Related searches feature
Continue reading Using Relevanssi without a search term

Using Relevanssi without a search term

Deprecated: Relevanssi has long supported searching without a search term. These instructions are not necessary. Version 1.7.3 introduces the possibility to use Relevanssi without a search term. This is useful when you have extra query arguments that can be used to narrow the search, but which would be useful without a search term present. This…

Read more Using Relevanssi without a search term 42 Comments on Using Relevanssi without a search term