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

  • 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.



    • Doug, have you set Relevanssi to actually index pages? Is “FAQ” perhaps a stopword?

  • FAQ is not a stop word and as far as I can tell it is set to index pages (I am not using posts within the site only pages). Here is a link to a screenshot of my settings:

    Any suggestions would be much appreciated.


  • Nothing obvious that comes to mind. Hard to say what’s wrong, without taking a closer look at your site.

  • lizard

    How do I insert a search box into a page?

    • Copy the default search box HTML code to the page.

      • Frank van Gilluwe

        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.

        • Well, every WordPress installation I’ve seen so far has a default widget called “Search”, which produces a default search form that works perfectly with Relevanssi.

          • seishindocbtp

            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!

  • Frank van Gilluwe

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

    • 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).

      • tom

        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.

        • 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.

          • tom

            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!

          • 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.

          • tom

            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?

          • 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.

          • tom

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

          • tom

            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.

          • 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.

          • tom

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

          • tom

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

  • L0cutus

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

    Thanks !

  • Kenn Nielsen

    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!

    • Kenn Nielsen

      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! 🙂

  • Nicolas Cusson

    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’

    • No, nothing that I know of. Can you figure out what the actual error is?

      • Nicolas Cusson

        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!

  • ian1234

    when I try to use it it just goes to this page –

    what is going on please, why does it not search my site?

    • Please be more specific. Try to use how? Looks like a problem with your search form, if the search term (?s=) is empty.

  • Andrei

    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?

    • 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.

  • Ali C

    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?

    • Ali, Relevanssi doesn’t have a function like this. It requires AJAX programming, but that’s all the advise I can give.

  • Pentti Stenman

    Is it possible to make Relevanssi to search from only one Media Category (pdf)?

    • 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.

  • Kristiyan Krastev

    any demo?

  • Krishna Ram

    Getting relevant results after using this plugin for our Website.

  • Jeff Haskin

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

    • Yes, you can. You need to add a taxonomy parameter in the search form, and a different one in the knowledge base search.

      • Jeff Haskin

        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?

        • Relevanssi needs to index both, and then you can use parameters to restrict the different searches to different results.

          • Jeff Haskin

            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”?

          • Yes, it’s mostly a question of adding a single parameter to the search form.

  • Another Bob

    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.


    • Setting the operator to AND should be enough, it shouldn’t need anything else. Try disabling the OR fallback – does that help?

      • Another Bob

        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!


        • 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.

          • Another Bob

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

      • Another Bob

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

  • Ameer Salah

    How I can add fuzzy search functionality.
    does it need some extra code?
    please response ASAP.

  • Narverødveien 40 Tester Test

    The result does not give a link for Product . How can I setting it?

    • That is up to the search results template, adjust that.

  • hanif khan

    What is sticky posts in searches based on search term.

    • For posts, you can enter search term, say “cat”. Now everytime someone searches for “cat”, that post will appear on top of the results.

  • Kevin Kelly

    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?

    • 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.

      • Kevin Kelly

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

  • James Cyrus

    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.

    • 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.

      • James Cyrus


        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.