• I am working on a website where we are using the following three plugins:

    Relevanssi (enhanced search)
    Yoast SEO (Search optimisation)
    Reusable Content Blocks (for content that appears on multiple pages)

    Relevanssi has the ability, when installed, to be used in the Admin panel search as well as on the front end search for the site, and if it’s installed at the same time as Yoast SEO, it looks like it requires the Admin Panel search option to be selected (or admin panel searches result in many duplicate entries where it displays the same result around 40 times).

    So, of course, we have the Relevanssi search switched on for the Admin panel.

    Unfortunately, this seems to break the search box at the top of the Reusable Content Blocks page – we get no results when searching this page if Relevanssi’s admin panel search is switched on, and if it’s switched off we get around 40 links to the same block like we do on content pages and posts.

    Is this a known issue, and is there a workaround for it to get Relevanssi’s admin search to work on the Reusable Content Blocks page?

Viewing 1 replies (of 1 total)
  • First of all, please tell me more why you need to keep the admin search in Relevanssi enabled with Yoast SEO. That’s the first time I hear of this, and it does sound a bit worrying. If you could post a thread on this on the Relevanssi support forums with instructions on how to reproduce the issue, that’d be really helpful.

    Second, add this to your theme functions.php:

    add_filter( 'relevanssi_search_ok', 'rlv_reusable_content_blocks', 10, 2 );
    add_filter( 'relevanssi_admin_search_ok', 'rlv_reusable_content_blocks', 10, 2 );
    add_filter( 'relevanssi_prevent_default_request', 'rlv_reusable_content_blocks', 10, 2 );
    function rlv_reusable_content_blocks( $ok, $query ) {
    	if ( 'rc_blocks' === $query->query_vars['post_type'] ) {
    		$ok = false;
    	}
    	return $ok;
    }

    That should disable Relevanssi in the Reusable Content Blocks admin searches. I’ll come up with a cleaner solution for the next version of Relevanssi and will have Reusable Content Blocks covered automatically, but meanwhile you can use this.

Viewing 1 replies (of 1 total)
  • The topic ‘Reusable block Admin search not working with Relevanssi?’ is closed to new replies.