• hi,
    I was wondering if its possible to enable matching the exact search terms, similar to using “quotes” around the terms?

    I’ve read a post about a developer suggesting a fix that added a radio button to allow this, but its not something I can do, I wish to match exact search terms everytime.

    anyone have any suggestions?

    http://wordpress.org/extend/plugins/relevanssi/

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

    (@msaari)

    add_filter('relevanssi_modify_wp_query', 'add_quotes_to_search');
    function add_quotes_to_search($query) {
        $query->query_vars["s"] = '"' . $query->query_vars["s"] . '"';
        return $query;
    }

    Add this to your functions.php to add quotes to every search query. That’s a basic proof of concept version – you should add at least a check to see if the search query already has quotes.

    I don’t recommend this, however, as in most cases this will reduce the usability of the search.

Viewing 1 replies (of 1 total)

The topic ‘Matching Exact Search Terms’ is closed to new replies.