• Resolved pampfelimetten

    (@pampfelimetten)


    We have a custom post type which is shown separately on its own archive page and which should not get indexed by relevanssi. I wanted to implement a simple custom search box for the post type on the archive page, by using WP_Query with the s argument.
    The problem is, that relevanssi hooks into the search query and thereby returns an empty search result.
    I tried

    
    function kupf_dont_use_relevanssi () {
    return false;
    }
    add_filter ("relevanssi_search_ok", "kupf_dont_use_relevanssi");
    $books = new WP_Query( $args );

    But it isnt working. Any help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari

    (@msaari)

    That’s not how you disable Relevanssi. The correct way to disable Relevanssi is running

    remove_filter('posts_request', 'relevanssi_prevent_default_request'); 
    remove_filter('the_posts', 'relevanssi_query', 99);

    before the WP_Query.

    Thread Starter pampfelimetten

    (@pampfelimetten)

    Thanks works like a charm!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not able to deactivate it’ is closed to new replies.