Continue reading Hidden WooCommerce products in search

Hidden WooCommerce products in search

Relevanssi by default shows out-of-stock and excluded from catalog WooCommerce products in the search results, but hides those set to excluded from search (before 2.2.2 and 4.1.2 the default behaviour was to show all products). It is quite easy to make Relevanssi not to display hidden products in the results. The best way is to…

Read more Hidden WooCommerce products in search 21 Comments on Hidden WooCommerce products in search
Continue reading Controlling attachment types in index

Controlling attachment types in index

Relevanssi lets you index attachments – not their contents, but the names and descriptions. But perhaps you only want to index a particular type of attachment? Relevanssi settings don’t have any control over that, it’s either all attachments or nothing. It is possible to choose which kinds of attachments are indexed. It is done with the…

Read more Controlling attachment types in index 14 Comments on Controlling attachment types in index
Continue reading Excluding posts by taxonomy

Excluding posts by taxonomy

Relevanssi has a category exclusion feature built in, but that only works for basic categories and not any other taxonomies. You can use tax_query to restrict the searches as well, but that’s more complicated than adjusting the setting in Relevanssi settings. However, if the exclusion is permanent, it’s best done in the indexing level. That…

Read more Excluding posts by taxonomy 20 Comments on Excluding posts by taxonomy
Continue reading Deindexing Yoast SEO noindex posts

Deindexing Yoast SEO noindex posts

If you use Yoast SEO to mark posts “noindex”, you may want to have Relevanssi deindex those posts as well. It’s easy to do using the relevanssi_do_not_index hook. Just add this function to your theme functions.php: add_filter(’relevanssi_do_not_index’, ‘rlv_yoast_noindex’, 10, 2); function rlv_yoast_noindex($do_not_index, $post_id) { $noindex = get_post_meta($post_id, ‘_yoast_wpseo_meta-robots-noindex’, true); if ($noindex) $do_not_index = true; return…

Read more Deindexing Yoast SEO noindex posts 1 Comment on Deindexing Yoast SEO noindex posts
Continue reading Excluding protected posts

Excluding protected posts

A site I’m working with has a handful of “protected” posts (password required to view). For various reasons, we don’t want to show these in search results. While there is no excerpt shown, I’d prefer for people to not even know they exist. Relevanssi sees protected posts as public posts (because their post status is…

Read more Excluding protected posts 11 Comments on Excluding protected posts