Posted on

Yoast Local SEO compatibility issues

Yoast Local SEO plugin breaks Relevanssi search. It enhances the search by adding meta queries. Unfortunately they don’t work with Relevanssi. The fix is simple, though:

add_filter('relevanssi_modify_wp_query', 'rlv_meta_fix', 99);
function rlv_meta_fix($q) {
	$q->set('meta_query', '');
	return $q;
}

This clears out the meta_query.

  • Kailash Shirsat

    where i have to add this code?

  • johnnyfarr

    Put this in my functions.php and it still doesn’t work – the results are still blank! Whenever I disable Yoast Local, everything works fine, when I enable it, blank search. Any suggestions? Using Genesis WP Theme

    • If you add

      global $wp_query; var_dump($wp_query->query_vars);

      on your search results template, what does it print out?

  • Eduardo Sterman

    Hi, I did that code, you mentioned below and it prints:

    array(0) {}

    I have themeforest’s Belief Theme, and I can see their template builder has layout settings for the search page (adjusted to “default” template here)

    I disabled ACF and Yoast SEO, still the results come out blank like in this attachment.

    I can see the index is working fine on the settings page, but no results after searching on the front end

    What should I try?

    • Eduardo Sterman

      I took the print while trying something to make Relevanssi work, don’t mind the “blog page” header, it reads “Search Results” normally here but no results. if I disable Relevanssi, search results appear normally

    • Try disabling your theme. It may be your theme is incompatible with Relevanssi.