User manual

Learn how to use Relevanssi. This manual covers both free version and Premium. It is very much a work-in-progress right now.

Table of contents

86 comments User manual

  1. Hello,

    I would very much like to use your plugin but for some reason it will not find pages titled “FAQ”. I have quite a few pages with FAQ in the title and I can’t figure out how to get those pages to appear in the search. These pages do use a shortcode and I clicked the box to inflate the shortcode but still nothing. Any help would be much appreciated.



      1. Where do you get the default search box HTML code? Existing search box from WordPress doesn’t seem to do anything differently (after Relevanssi install and indexed). Can’t find anything about the html code in the user manual, which seems like a critical step to document and explain.

          1. This was a bit hard from me to understand as well. So your plugin enhances the default Search widget? I was looking all over the setting for a place that would say how to show your specific search box. Just a suggestion…make this a bit more obvious. “Relevanssii enhances the default WP search widget. All you need to do is install our plugin and you then use the Search widget that comes with WP.” Something like that.

            Thanks for such a nice plugin, though!

          2. How do you get the search to appear in the nav bar? I tried the widget function under my Nav widget with custom query wideget and it appears underneath the section and I want it next to my menu options. I suspect the this has to do with the hierarchy of the widgets. Is there another way to solve this problem?

  2. Is there a reason you don’t use search on this site? Seems strange to sell a Search product, then not use it yourself.

    1. does use Relevanssi for search, but looks like when I updated the theme, the search form disappeared somewhere. Since I don’t need it myself, I haven’t noticed before. Thanks for the notice, the search is now available (and of course uses Relevanssi Premium).

      1. Is there any way you could possibly provide a working example of a search results page which works with this plugin? To have a site which uses get_posts() or new WP_Query() but doesn’t work with this plugin is fine… if you could provide what DOES work in its place. Big thanks.

        1. All WP default themes work just fine with Relevanssi. See what they are doing.

          There’s no general solution to this, the correct answer depends on the site. If you can post your search results template in a pastebin somewhere, I can give some hints on how to fix it.

          1. Most impressed by your fast response. About 10 seconds ago, I went into the WP 2012 theme and pulled search.php to see what it’s doing. It actually produced results(!) but I am not sure how Relevanssi is involved yet or how to make it work for us with the “fuzzy logic” we need. It’s still too early but I will definitely look closer at it and play with it and read more about it. I am just happy to get some results! I will try not to bother you unless I really need help! Thank you for your effort!

          2. The thing is, Relevanssi replaces the first posts loop on the search results page. The problems begin, if the template doesn’t use the original posts loop provided by WP, but instead makes another query (with get_posts() or new WP_Query()) – Relevanssi doesn’t get involved in that second loop.

          3. I see. (and again big thanks for your reply! this is very urgent for me)

            I have my search results page now giving suggestions. This is great! However…. What I need to do is display them BY POST TYPE. We want to keep our search results exactly as they are using query_posts()…. but want to use Relevanssi to GUESS “what did you mean?” and offer alternate suggestions if they spelled something wrong. (for example)

            Is there any way to keep our existing search results and use relevanssi to offer a additional suggestions?

          4. As I don’t have a clue how your search results are right now, I can’t tell you how to do that with Relevanssi. Filtering results by post type is simple, and having “Did you mean” suggestions is a matter of adding the one function call – but what else do you need? I don’t understand that.

          5. Of course. I will explain in a reply to your email. Very grateful for your attention on the matter. Thank you.

          6. Hi Mikko. Is there anything you can do to suggest how it’s possible to get the Google -style “did you mean?” alternative suggestion? Your plugin page says the plugin can do this, but I cannot generate this no matter what I try. Do you have an example search results page which will output some proper results. I get a loop of 10 results (at most) but no suggestions if I spell something wrong. Please assist. I would be most grateful.

          7. Tom, Premium does what you want. The free version has the feature as well, but it’s based on earlier user searches and won’t work until there are enough logs gathered. Premium has a better version, directly based on your database.

            For installing instructions, see “Did you mean” suggestions.

          8. Hey! Thanks for your reply. OK purchased premium and looks to be cool. Replying to your email.

          9. Ideally I want someone to search for (example) “Ferrr”… and be able to say “did you mean FERRARI?. That’s the goal.

  3. is possible to find every Author’s post ?
    does exist a function to receive only the number of result found by the search ?

    Thanks !

  4. Hi Mikko,
    I want Relevanssi to search pages, but I want to exclude some. E.g. page such as privacy policy, terms of sales etc. – Is it not possible to exclude such pages in some way?
    I have tried several solutions, but nothing do the trick.
    Thank you in advance!

    1. Hah! Got it 🙂

      “Exclude these posts/pages from search:

      Enter a comma-separated list of post/page IDs that are excluded from search results. This only works here, you can’t use the input field option (WordPress doesn’t pass custom parameters there). ”

      Thank you! 🙂

  5. Is there any issues with relevanssi_do_query()? I am able to use relevanssi in the global search, but when i use relevanssi_do_query() for an AJAX call it, returns ‘Internal Server Error’

      1. No, I haven’t found a solution yet. Sorry for the delay, we had to temporarily deactivate Relevanssi to meet the dead lines. I will need to reinvestigate the issue. However, I will have to do a couple updates first, maybe it will be enough. From what I remembered, the error was not really explicit, the only thing i could see in the console was ‘Internal Server Error’, but again, I will come back with more information tomorrow. Thanks for you support!

  6. Hello and kudos on your work. I am not sure if this has been covered but I did try to find an answer with no results.

    I am using a custom theme that has its own search system, and it seems to be different than the default WP search since the coding is different. The form id is set to a different class and the input class is different as well.

    Question is: does your plugin improve any currently used search or only with the default WP search?

    1. The form ID doesn’t matter – the only thing that matters is the “action” in the form tag and that the search term input field is called “s”. If those match the default search, Relevanssi doesn’t mind anything else.

  7. How would I go about adding the function for automatically filling in the search as the user types, such as the user has typed “Brent C” and then automatically “Brent Cross Shopping Centre” is filled in similar to the way Google search does it? Only I would create a catalogue of these guesses. Can you advise? Is this in the free or premium version?

    1. Yes. Relevanssi won’t search inside the PDF files, though, but it’s easy to limit the attachment search to just one media type. I’ve done that before: it’s couple of lines of code.

  8. Can I restrict results to just one taxonomy when users search from the knowledge base, and another when searching from the blog?

      1. Thanks! Right now, I’ve set it to only index the articles in the knowledge base. Should I index both the blog articles and the knowledge base articles so that the taxonomy will work in the blog, or will the taxonomy override this?

          1. I’m a novice and have no idea where or how to make these changes (I’ll try hard to figure it out though). If I buy the premium version, would this type of help be included in the “guaranteed support”?

  9. Can someone point me to a tutorial on how to set up Relavanssi to avoid the following issue?
    I need to search for products that have “over lapping tags”. What I mean is that my visitors search for “Clemson Tigers” but the search also returns “Savannah State Tigers”. How do I set it up to not return the other tags that share one of the search terms? I have already set the operator to “And”.

    Will I need the Premium version? That’s OK, I’ll buy it,. I just really need a tutorial for dummies so I can make it work properly.

    The website is I didnt make the site but it’s my job to fix it. I’m new to wordpress so I really don’t know what I’m doing in this environment.


      1. Hello Mikko, Thanks for the quick reply.

        No that didnt work. Here is another example.

        There are two shirts tagged with “Florida State Seminoles”, a red shirt and a white shirt.

        When I search for “Florida State”. I get one shirt that is tagged with “Florida Gators” and “Savannah State Tigers”, and another shirt that is tagged with “Florida State Seminoles”.
        Somehow I do not get both of the shirts tagged with “Florida State Seminoles”. If I search for “Florida State Seminoles”, I get only the white shirt.
        Searching for “Seminoles” gets both shirts.

        Maybe my description isnt clear. This is the search page if you want to see for yourself:

        Can you think of some mistake in the site that could cause this issue? Can you think of a way to work around it?

        Thank you very much!


        1. Hi, sorry, can’t really tell anything more just by looking at the site. I’d need to see under the hood to tell what’s going on.

          I would at least try rebuilding the index, tag indexing can have some issues if the tags are edited after the post is indexed.

          1. Some of the tags have been changed. I’ll try rebuilding the index, as you suggested. Thank you!

      2. Actually the Clemson Tigers example seems to work now but the Florida State Seminoles example still is not working

          1. 1) Have you made sure the search is powered by Relevanssi in the first place?

            2) Have you installed the “Did you mean” feature? It does not appear automatically, you need to install it yourself. The fuzzy search feature has nothing to do with that.

  10. Having a problem with my search and wondering if there is a fix that you could help with. We have several page titles that have “s” at the end of the word like “credit cards”. However, most people will search for “credit card” and because of the frequency of the words credit and card on the site, those results come up before the actual page with that title. Any advice on how to adjust it because adjusting weights has not seemed to help?

    1. No easy solutions here, unfortunately; if those are common words on your site, getting the right pages to rank high can be hard. Easiest solution would probably be buying Relevanssi Premium so you can use the pinning tool: there you can choose the posts you want on top of the results and pin them for those search terms. Then whenever someone searches for “credit” or “card”, the pinned posts will appear highest on the list.

      Premium also includes a simple stemmer, which can normalize every occasion of “card” or “cards” to be the same, which may also help. But I think pinning will be the easiest and the cleanest solution here.

      1. Thank you for the prompt response. I’ll probably trying adjusting stuff a bit more, but the pinning seems like the solution. Thanks again

  11. Mikko – We (I work with Kevin Kelly) recently purchased Relevanssi Premium (for the pinning content functionality) and it works beautifully, however, we’re also using Visual Composer on a most pages.

    After some research, I was directed to this post:

    which helped me get rid of the VC wrapper elements in search excerpts just fine, however, it caused another issue.

    Some of our pages have iframe content, which is not being stripped out correctly.

    I’ve tried to debug as best as I can:

    – When I disable the Relevanssi Premium plugin, the search excerpts render fine. With no VC content wrappers, nor with a rendered iframe.

    – When I enable the plugin (without the filter), the search excerpts display the VC content wrappers, and render the full iframe contents in the results.

    – When i enable the plugin WITH the “relevanssi_pre_excerpt_content” filter, they are rendered with no VC content wrappers (as expected), but iframe contents are rendered as gibberish, as shown in the screenshot.

    Any information you could provide would be helpful – or let me know if you need more information. Thank you.

    1. Hi, first of all – you have a Premium license, which gives you access to Premium support. Do use that, it gets you answers faster.

      You’re close to the solution, actually: I think you can use the relevanssi_pre_excerpt_content to remove the iframes from the content before excerpt-building. That should get you cleaner excerpts.

      You can var_dump() the content in the filter to see what’s there at that moment, to help you figure out what exactly you need to clean out.

      1. Mikko:

        Thanks for the response. I actually did get it figured out. I used the same pre_excerpt_content function and just had to find the right RegEx to strip the iframes and content. (I’m not overly familiar with RegEx, so that took a little bit of time).

        $content = preg_replace(‘(<iframes+.*?n)(.*.)(n.*)’, ”, $content);

        But all is well and working fine. Thank you.

  12. Mikko, is there a way to use your search on a specific page that restricts the eligible results to just one category? I want to create a list of terms for a glossary that all have the same category assignment, and then to allow users to search only that category.

    1. Sure, just add a hidden input field with the name set to “category” and value set to the category ID in the search form on that page. That’ll restrict the search to that one category.

  13. Hi
    I am using Relevanssi for admin area search for custom posts. But I just noticed that you can search only the already indexed post and if you create a new post, you can get it in search result until you re-index the posts. is it right? I am using the free version.

  14. Is there a way to display a different page when there are no results found for a given search? For instance, when someone searches on our site, we have a phrase and an image that basically says, “we found what you’re looking for”. What we’d like to do is have a different phrase and image come up when there were no matching results.

    Additionally, it would be great to include the search box in the content area of that page so they can easily do a different search.

    Any assistance would be greatly appreciated!!

    1. Laura, this is just a question of modifying the search results template from your theme. That’s what is responsible for all that. You can modify the “no content found” part of the template as much as you wish, and adding a search form isn’t difficult either. The exact details depend on which theme you are using and how that is built.

  15. Hi, I downloaded the free version to test it but it doesn’t seem to make a difference at all. Is there a period of time I have to wait? I re-indexed to make sure it picked up the rules.

    The basic thing is, we’re a school and we want the “Title IX” page to show up if someone does an internal search for rape or sexual assault (it does not come up at all, there’s a lot of random and irrelevant pages).

    I opted for synonyms, as well as “and” searches, but everything seems exactly the same as before the plug in?

    I don’t think we even have 500 total pages – is that the issue?

    1. Mari, Relevanssi will start to work immediately after you activate the plugin and build the index, if your theme is compatible. Your site is using Google Custom Search, the search results are not powered by Relevanssi. You need to first disable Google Custom Search first, so you get the WordPress default search results.

  16. Results page problems. I love the great reviews & decided to replace Better Search with Relevanssi. I think I did wrong something wrong, because my results page does not give results, but does have this shortcode: [siq_ajax_search] ,

    My guess is I need a different shortcode, or is it something else?

    btw, I am using Generate Press premium theme.

    1. Gloria, you’ve been using some kind of AJAX search results. It’s either from your theme or some third plugin, because that shortcode is not from Better Search, either.

      Relevanssi doesn’t need any shortcodes on the search results page, but instead needs a regular search results template. GeneratePress should include one, as far as I can tell, since it’s a very basic WordPress feature.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.