Installing Relevanssi and adjusting the settings

Installing Relevanssi is simple.

For free version, install the latest version of the plugin from plugin repository.

For Premium, download the latest version from and either upload the zip file using the WordPress plugin installation or unzip it and upload the files with FTP in the /wp-content/plugins/ directory.

After installing, check Settings > Relevanssi to adjust the settings and build the index.

Search widget

Relevanssi doesn’t come with a search widget. You can use the default WordPress search widget or any other method that generates a standards-compliant search form.


Overview tab

On the overview tab, you’ll find the API key setting (Premium only). If you’re on a multisite network, the API key field is not here, it is in the Network admin dashboard.

Enter your API key here to enable automatic updates and PDF indexing. API key can be found here on – it’s in the sidebar when you’re logged in.

Hide Relevanssi on edit pages (Premium only) hides everything about Relevanssi from post edit pages.


Indexing tab
Indexing tab

All options on this tab affect the indexing and won’t have any effect until you build the index. You need to save the options before indexing. Clicking Build the index will wipe the index clean and rebuild the complete index, based on the indexing settings you’ve chosen on this tab. The indexing will run until it’s finished. It can take a while, especially on a large site, but the indexing process will show an estimate of the remaining time. Keep the browser window open as long as it takes to index.

If for some reason the indexing is interrupted, you can click the Index unindexed posts. This will index all the remaining posts (including all post types). This button can be useful if you import posts in a way that doesn’t trigger Relevanssi indexing: just click the button after the import to index all the new posts.

State of the index shows the number of documents (posts, pages), users and taxonomy terms (Premium only) in the index, number of terms (words) in the index and the highest post ID in the index. These are useful for debugging purposes, for example to see if the indexing works.

Post types
Just check the boxes for each post type you wish to include in the index. The “Excluded from search?” column shows whether the post type is marked public or not, but it doesn’t mean you can’t index those post types. It’s just for information.

Choose which taxonomies are indexed for the posts. If you check a taxonomy here, it means that searching for the taxonomy term name will find all posts that have this taxonomy term attached to them. Again, the “Public?” column is just for your information.

Choose which comments are indexed. You can choose to include only regular comments or also include pingbacks and trackbacks.

Custom fields
Choose which custom fields are indexed. “All” includes all custom fields assigned to a post, “visible” only those that are shown on the edit page. If a custom field name starts with an underscore (_), it is hidden from the post edit page, and won’t be included if this setting is set to “visible”. Since some themes can add quite a bit of behind-the-scenes data in the custom fields, “visible” is a reasonable setting. You can also choose to index only specific fields you list.

Relevanssi Premium supports ACF repeater fields, using the notation fieldname_%_subfieldname.

Author display names
If this option is enabled, Relevanssi will index author display names. Searching for an author will find all posts written by the author.

If this option is enabled, Relevanssi will index post excerpts.

Expand shortcodes
If this option is checked, Relevanssi will expand all shortcodes in post content before indexing the post. That means the shortcode content will be included in the index. This doesn’t always work as expected. If the shortcode provides dynamic content, Relevanssi will index the post with the content at the moment of indexing, and won’t update the index when the dynamic content changes.

Some plugins don’t enable their shortcodes in the admin side, so Relevanssi can’t expand them. Some plugins, especially those that don’t respect WP programming standards, may break Relevanssi. If indexing doesn’t work, one of the first things to try is to disable this option.

Disable these shortcodes (Premium only)
You can list unwanted shortcodes here: if a shortcode is causing problems in indexing, list it here and it will be disabled when Relevanssi indexes posts.

Index user profiles (Premium only)
If this is checked, Relevanssi will index user profiles. Relevanssi indexes first name, last name, display name and user description. You can also index other data for users, see two options down.

Since WordPress expects the search results to be posts, Relevanssi needs to convert the user profiles to posts. That requires some changes in your search results template. the_permalink() should work in most cases, pointing to the user profiles. See User profile search for more information.

Index subscribers (Premium only)
If checked, Relevanssi will also index subscribers, otherwise only admins, editors, authors and contributors are indexed.

Extra fields (Premium only)
If you want to index other user fields, you can list them here. These field names should correspond to MySQL database columns in the wp_user table or user custom fields.

Index synonyms (Premium only)
Synonyms generally only work in OR searches: the synonyms are used by adding more words to the search query and in OR search that works as expected, widening the search. In AND search, it will restrict the search, so it won’t work. Enabling this option will make Relevanssi index the synonyms as part of the post content, making them compatible with AND searches.

Index taxonomy terms (Premium only)
If you enable this option, you can index taxonomy term pages. If this option is enabled, searching for a taxonomy term name will return the term archive page as a result. By default, Relevanssi only indexes those terms that are attached to posts. With this option enabled, get_permalink() won’t work on search results template. the_permalink() does, but if you don’t want to echo the permalink, you can use relevanssi_get_permalink() instead. See Indexing taxonomy pages.

Taxonomies controls which taxonomies are indexed.

Index for parent (Premium only)
If checked, Relevanssi indexes the PDF content both for the attachment post and the parent post. You can control the attachment post visibility by indexing or not indexing the post type attachment.

Advanced indexing settings

Minimum word length
Enter an integer. Words shorter than this many characters are not indexed. The default value 3 is pretty good for English, for other languages other values may make sense.

Punctuation control
By default Relevanssi removes some punctuation completely and replaces the rest with spaces. These fields give you control over the most common punctuation types: ampersands, hyphens, dashes, apostrophes and quotes. You can define the behaviour for all of these classes. The correct settings depend on what kind of content you want to search, but the default values make sense in most cases.

Thousands separator (Premium only)
This option helps indexing large numbers. Particularly in languages like Finnish where the thousands separator is a space, you can enter space here and have numbers like “1 000 000” indexed correctly as “1000000”. Since Relevanssi replaces periods and commas with spaces, using this option will make sense with those separators as well.

MySQL columns (Premium only)
If you have a plugin that writes the data in a custom column in wp_posts MySQL table, you can add the column name here to have that data indexed.

Internal links (Premium only)
This option sets how Relevanssi handles internal links (links that point to your own site). If you choose “No special processing”, Relevanssi doesn’t care about links and indexes the link anchor (the text of the link) like it is any other text. If you choose “Index internal links for target documents only”, then the link is indexed like the link anchor text were the part of the link target, not the post where the link is.

Attachments (Premium only)

Attachments tab
Attachments tab

Attachment tab handles the PDF content reading. If you have PDF files in your Media Library, Relevanssi can read in the PDF contents so that they are available for indexing.

In order to read the contents of the PDFs, the files are sent over to, a PDF processing service hosted on a Digital Ocean Droplet in the USA. The service creates a working copy of the files. The copy is removed after the file has been processed, but there are no guarantees that someone with an access to the server couldn’t see the files. Do not read files with confidential information in them. In order to block individual files from reading, use the Relevanssi post controls on attachment edit page to exclude attachment posts from indexing.

Read all unread PDFs reads in all the PDF content in attachments. This does not wipe the index, and will only process those PDFs which haven’t been read yet. If reading the PDF caused an error message before, the PDF will be skipped, unless the error message is a time out, in which case it’s attempted again.

Reset all PDF data from the posts will empty out the PDF information from the posts. It is stored in the attachment metadata: content in _relevanssi_pdf_content and errors in _relevanssi_pdf_error. Clicking this button will wipe these custom fields empty.

Upload PDF files
By default Relevanssi sends a link to the PDF to the reading service, which then downloads the PDF and reads it. However, if your files are behind a firewall, in an intranet or otherwise not accessible from the outside world, this is not going to work. In that case, check this option, and Relevanssi will upload the files directly.

Link to PDFs
If you decide to have attachments in search results (by indexing the attachment post type), by default the links in search results pages will lead to the attachment page. That’s often less than helpful, as it’ll take one more click to reach the actual PDF. Enabling this option will make the search results pages link directly to the PDF file.


Searching tab
Searching tab

Default operator
OR search will return all posts where at least one of the search terms appears. AND search will only return posts that have all search terms in them. OR search will prefer posts that have all search terms in them, so in most cases it is the better option.

Fallback to OR
If you have chosen AND as the default operator and the search finds no results, Relevanssi will perform an OR search with the same search terms. If you want to disable this, check this option.

Default order
By default Relevanssi orders results by relevance, trying to put the most relevant results first. This makes a lot of sense. Some people prefer other methods. From the settings page, you can choose post date order, most recent posts first. If you want other orderings, you can use the orderby parameter. For multiple levels of ordering, Relevanssi supports array orderby.

Keyword matching
Relevanssi can match whole words or partial words. Matching whole words means only complete words are matched. If you search for “ledge”, you will only find documents that contain the word “ledge”. Partial words also matches parts of words, so searching for “ledge” will also finds documents that contain words “knowledge” and “ledger”.

The search term has to be either in the beginning or the end of the word, so searching for “ion” will find “caution” or “ionized”, but not “cautionary”.

Here you can adjust weights for different features like post titles, tags, comments, different post types or taxonomies. Some of these adjustments are Premium only. All the weights work the same way: they are multipliers, so 1 keeps the weight neutral compared to everything else, below 1 makes the weight smaller and values over 1 make the particular item weigh heavier in the matching.

If you want to emphasize something, don’t be afraid of using big numbers. If you want to make sure that posts with the search terms in titles come up in the search, slap a weight of 100 or 1000 for the titles. Subtlety is overrated.

Recent posts bonus cutoff (Premium only)
If you’ve added extra weight for recent posts, this option determines which posts are considered recent.

Admin search
If you enable this option, Relevanssi will be enabled for admin searches. Otherwise default WordPress search will be used in all searches in the admin interface. Admin searches may not always work very smoothly. For example page search will not use Relevanssi, because that’s just how WordPress works.

Respect exclude_from_search
If you check this option, custom post types which have exclude_from_search set to true will be excluded from the search. If the option is unchecked, Relevanssi won’t respect that setting and will search anything that is indexed.

Throttle searches
On large sites searches can become heavy to process, particularly when there are common words involved. Relevanssi has to load every post that is found by any search term, and that can require lots of memory. In most cases, the user only cares about the few posts on the first page of search results.

This option will restrict Relevanssi to only first 500 posts per search term. Relevanssi will only take the first 500 posts per search term, so the maximum number of posts Relevanssi will load in memory is 500 times the number of search terms. The 500 posts are chosen with some sense, so it is very likely the best posts are within those 500 posts. This way the search becomes more effective and less memory-intensive. On a small site this option isn’t necessary – if a single search term finds less than 500 posts, the limit of 500 doesn’t make any difference – but on a large site this is very useful option, and I recommend you use this option all the time.

Do note that choosing the probably best posts only works with the relevance ordering. If your order posts by date, it is quite likely the limit will drop out useful posts. If you need to have the limit and you want posts ordered by date, I suggest you set Relevanssi to relevance order, use a limit and then use orderby parameter to sort the results by date.

Category restriction
If you want to restrict search to a particular category, you can do it here.

You can also use the input field ‘cats’ to do this on a search form basis, that’s the more flexible way to handle this. If you use both the input field and this option, the input field will overrun this.

Category exclusion
Here you can permanently exclude categories from search. The ‘cats’ input field also takes negative values for exclusion.

Post exclusion
If you want to permanently exclude posts or pages from search, you can list their numeric IDs here. In Premium, you can also use a checkbox on the edit pages to exclude posts. That is easier to use and works in multisite searches, unlike this option.

Search all subsites
Checking this option will automatically make the search on this site include all subsites. It’s the equivalent of setting the searchblogs parameter to all on all search forms on the site. If a search form includes the searchblogs parameter, it will override this setting. You still need to modify the search results template to get working permalinks, this (and the next) setting is just a shortcut for setting the searchblogs parameter.

Search some subsites
You can add a comma-separated list of blog IDs to have all search forms on the site search these subsites. If a search form includes the searchblogs parameter, it will override this setting.


Logging tab
Logging tab

Keep a log of user queries
If you enable logging, then you’ll find the searches logged and presented in Dashboard > User searches. Logs are necessary for the Did you mean function to work in the free version.

Log user IP
Enable this option to log the user IP addresses. Do note that this may be illegal in your jurisdiction, or require GDPR paperwork. The IP addresses are not visible on the User Searches page, but can be found in the wp_relevanssi_log database table.

Exclude users
If you want to disable logging for particular users (like yourself), add a list of comma-separated numeric user IDs or login names here. “admin” is a good start, unless you’ve changed the main user login name.

Hide Relevanssi branding (Premium only)
Useful option if you’ve installed Relevanssi on a client page, this will remove all Relevanssi branding on the user searches screen, so your client won’t be confused.

Trim logs
The log database can get large. It is possible to automatically trim the logs. Enter a number here, and the logs older than that many days will be automatically removed.

Export logs
Clicking the button exports the user searches log as a CSV file.

Excerpts and highlights

Excerpts & Highlights tab
Excerpts & Highlights tab

Custom search result snippets
To have Relevanssi create custom excerpts highlighting the hits in searches, you need to enable this option. Relevanssi will then replace the post excerpt with something it has created on the fly (so the original post excerpt is overwritten, but only for the particular search, not permanently; also, the original excerpt is available in $post->original_excerpt).

To see the excerpts, make sure your search results template is using the_excerpt(). If your search results template uses the_content() or something else to show the post content, it’s possible you won’t see the Relevanssi excerpts.

Length of the snippet
Choose the length of the excerpt, either in words or in characters. Use words, it’s many times faster than using characters.

Allowable tags in excerpts
List of all HTML tags that should be allowed in the excerpts. List the tags without any whitespace, like this: <p><a><strong>.

Use custom fields for excerpts
If you are searching custom fields, by default Relevanssi doesn’t use the custom field content to build excerpts. If you check this option, Relevanssi will use the custom fields it is indexing as a source material for excerpts.

Highlight type
Here you can choose the method of highlighting used: <mark>, <em> or <strong> tags, text colour, background colour, CSS style or CSS class. CSS style means you later enter CSS stylings, which are used for highlighting (<span style=”your style”>). If you wish to keep styles in separate files, use CSS class (<span class=”your class”>).

Highlight in titles
Titles are not highlighted unless you enable this option. You also need to replace the_title() in the search results template with relevanssi_the_title().

Highlight in documents
If you check this option, the search terms are also highlighted in the posts that are opened from the search results. This requires an extra parameter (highlight) to the links from the search results pages so in order to get these highlights, you need to use relevanssi_get_permalink() or relevanssi_the_permalink() to print out the permalinks on the search results templates.

Highlight from external searches (Premium only)
Highlights search terms from external searches. Currently this feature works with Bing, Ask, Yahoo and AOL searches. Support for other search engines is available on request, but Google is not an option.

Highlight in comments
If you enable this option, Relevanssi highlights query terms in comment text, when you open the post from the search results page.

Highlighting problems with non-ASCII alphabet?
Most people need not uncheck this, but if you’re using for example Cyrillic alphabet and the highlighting doesn’t work properly, unchecking this option will help. By default the highlighting regexp is using word boundary markers, and those do not always work properly with non-ASCII characters.

Breakdown of search hits in excerpts
If this is checked, Relevanssi will add extra information in the end of the search result excerpts.

The breakdown format
If you enabled the breakdown, this option determines what is shown. There are couple of keywords you can use: %body%, %title%, %tags% and %comments% show the number of hits in body, title, tags and comments. %total% shows the number of hits in total. %score% shows the relevancy score of the post. %terms% shows how many hits each search term has. Try and see how each one of these works, %score% and %terms% are the most interesting keywords in most cases.


Synonyms tab
Synonyms tab

Synonyms can be used to make search more powerful. If you have for example lots of abbreviations in your posts, but some posts use the non-abbreviated form, you can make those two synonyms for each other. Searching for one will find the other.

Synonyms are entered as “word=word” pairs. The pairs are one-way, so if you enter “sdj=spiel des jahres”, any searches for “sdj” will be expanded to search for “spiel des jahres” as well, but it doesn’t work the other way around. If you want two ways, enter both.

Synonyms only work with OR search, where it’s possible to expand search by adding more terms to it (because that’s what synonym expansion does). In AND search, adding more words restricts the search further. In order to use synonyms in AND searches, you need to enable the indexing setting to index synonyms (Premium only).


Stopwords tab
Stopwords tab

Stopwords are words that are not indexed. Large part of any text will consist of support words that are pointless for searching. Those meaningless words would still be the biggest part of the index, were they left in.

Relevanssi has stopword lists for English (both US and UK), Portuguese (both Portuguese and Brazilian), Polish, French, Finnish, Spanish and German. The plugin should load in the correct stopword file based on your blog language setting. You can see the list of current stopwords on the settings page. If you want to remove a word, just click on it. You can also add stopwords.

If you add a stopword, it is automatically removed from the index, so you don’t need to reindex to see the effect. If you remove a stopword, it won’t be returned to index without a reindex.

Content stopwords

Content stopwords function just like regular stopwords, but are only applied to the post content. They are not applied to post titles, taxonomy terms or other parts of the post. Using content stopwords makes sense when you want to remove useless, common words from post content, when they might be meaningful when used in post titles.

25 most common words in the index
This list shows the 25 most common words in your index. These words often make good stopword material, so if you want to, you can click the icon after the word to make it a stopword.

Import or export options (Premium only)

Import / export tab
Import / export tab

This field contains all the Relevanssi options in serialized text format. You can simply copy them and paste them on another Relevanssi installation to copy the settings. Make sure both installations are running the same version of Relevanssi before you import settings, though.

155 comments Installing Relevanssi and adjusting the settings

    1. Just add it. WP under the theme has search functionality, theme can’t overrule it. Just copy the search form from any WP site – it’s a GET form that has the search terms in an input field ‘s’. Then it’s just a question of setting up a search results template, if the default doesn’t work.

      1. So, with your theme, we just use the default search widget? Or…do we add it somewhere? This could be made more clear in the documentation for us n00b users. You went in depth on everything else – but this.

        1. Yes, just use the default search widget. It is not mentioned, because in most cases, you really have to do nothing – just use the search widget your theme already has, and most themes do have one.

  1. Hi Mikko, I just tried to install the free version but am not seeing any changes in the search widget. I have a premium theme from Solostream (Wp-Mysterious) and also I have checked the “Use Search for Admin” box. What do I need to do to get this to work?

      1. Nope, there is no “query_posts()” in the “search.php” file for the Wp-Mysterious theme. Can you recommend another advanced search plugin that might work? Specifically one that allows users to search within certain categories or for posts that carry certain tags. Or might you be able to tell me what search plugin the website is using? That would be ideal. Thanks!

  2. Hi Mikko, is it possible to add more than 1 synonym to 1 word for example “red=rouge,rot,rod “?


      1. I am sorry to use your time, I have not have any issues but, is there a way to customize or personalize the output? I have created a Search page in WP but that does not affect the search page produced by the widget, I do not see any tab or way to access this and modify it in Elementor

        1. Jose, can’t really help with Elementor, I don’t know much about that. Outside Elementor, the way to modify the search results output is to modify the search results template, and you can do pretty much anything you want with that.

  3. I’ve just installed relevanssi on and basic search seems to work fine, the relevancy sort is great.

    However I can’t seem to get synonyms to work. I’m trying to get searches for prioritization to show results including prioritisation so entered:


    but searching for prioritization still returns no results. Searching for prioritisation returns about 10 results.

    Any ideas?

    And is there any general library of US/UK spelling synonyms available?



  4. I can’t seem to get synonyms to work either. I’ve entered


    But I still get 0 results if I search on “obits,” even though “obituaries” gets pages and pages of results.

    Any thoughts? Am I entering it in the box wrong — do I need quotes or anything? The method I’ve been trying is word pairs, 1 to a line. Should I comma delineate?

    Thanks so much.

  5. Hi Mikko. My client would like the search results to show the relevancy score,YET have the results displayed by DATE. I have selected this option in the settings: Default order for results: POST DATE. But it is still displaying by RELEVANCE. Any thoughts? can you help?

  6. I’m not certain if this is something I could use the synonyms feature for but when I search the word S&P I only get searches for the letter S and the letter P. Is there a way to treat the ampersand as part of the word? There are hundreds of posts with the word S&P in them.

  7. I am trying to exclude some pages with “Exclude these posts/pages from search:”. But it doesn’t work. Pages continue appearing on searches. These pages would be “635, 298, 639, 379, 294, 668, 1782, 147, 2920, 2874”. Some solution?

      1. Versión 3.3.5. I am not sure at all, but I think It’s running via Relevanssi. Our web is Can u check?

          1. And how can I be sure the website is using relevanssi? I have added the code in functions.php and after that, shown results have been different to WP results

          2. What code did you add? Relevanssi shouldn’t require you to add any code, anywhere. Also, do you have working search on your site somewhere? When I try to use the search on your home page, I don’t get any results page at all, I just get the home page.

          3. Ok, now I’m seeing a search results page. Looks like Relevanssi, yes. As for the exclusion not working – I’m not sure. There shouldn’t be any reason for it not to work; I just tested it on my test blog, and the feature works just fine.

  8. Hi Mikko,

    Thank you for creating this great plugin! Your work is benefiting a lot of WordPress users.

    Just a small question…

    I checked the box for highlighting query results in titles, but somehow no difference is shown. My site runs on the Genesis framework with a StudioPress child theme. The URL for you to test is:

    I haven’t got any posts of myself on it yet, just some demo posts. So you can try searching for ’email’ or ‘mobile’ to see how the results look like.

    Could you help me out with this?

    Thank you in advance!



    1. Hi, highlighting in titles requires changes in templates. Unfortunately, since you use Genesis, you’re pretty much out of luck, unless you’re skilled in Genesis template editing – it’s not an easy thing to do. You’d have to change the_title() functions in the template to relevanssi_the_title() – a very simple thing, but rather complicated with Genesis.

  9. Can I create multiple search boxes with different setting? So on certain pages I want the search bar to be restricted to a set of categories, but for the search bar everywhere else I want it to search site-wide?

        1. No, not in particular, but there’s not much need, either. Just create a search form that has a category parameter (hidden input field named “cat”; for exact parameters see WP_Query documentation in WP Codex), then create another search form with different parameters, and place those as you see fit.

      1. I did, but post excerpts are still indexed and this is a problem for me. Can you think of anything that went wrong?

        Thank you

  10. I’m newbie with installing wordpress script. Is this a way that I can add this pluggin into my menu nav?


  11. I am having trouble entering stopwords containing apostrophes. When I add “aren’t”, it displays as “aaren\\\’t”. Furthermore, if I click on it to remove, it won’t let me. Showing error msg: “Couldn’t remove term ‘aaren\\\\\\’t’ from stopwords!”

      1. Thanks for the update, Mikko. I am now able to add stopwords like “aren’t” but still can’t remove the old ones, same error. Any suggestions? Perhaps manually remove them from the DB?

  12. Installed relevanssi and can’t get the synonyms to work either. I have the default operator on “OR” so I can’t figure out what I’m doing wrong.

      1. I thought installation and activation meant that Relevanssi would then enhance the existing search capability in WP. Is there something else I need to do to invoke Relevanssi searching?

        1. Generally no, but some themes block Relevanssi from working and need extra work. Checking whether Relevanssi is actually powering the search is one of the basic debugging steps if you have problems with Relevanssi.

          1. That’s the first I ever hear of that theme, so no idea. Try switching to one of the default themes – does the search work then? If it does, then the problem is likely your theme. If it doesn’t, then it’s something else.

  13. Could the problem be that the search functionality is going against form entries rather than a page with text?

      1. No they aren’t posts – I’m new to this – so should I put the spreadsheet in a post somehow and just not show that post?

  14. With relevanssi enabled for admin search, I get no results, when I search my menu to find posts or pages. I need the admin search because I have 10,000 posts and relevanssi helps me get more accurate search results when looking for post name, so it is working great when just looking for posts in the general post section admin search, but when I want to find a post to add to my main menu (under appearance), the search brings back 0 results. Any ideas how to fix this?

      1. Hey! I’m not sure if you fixed this yet. I have the same problem when searching for pages in the actual pages section. Relevanssi turned on for admin simply returns 0 results.

  15. Not able to search the Chinese text..
    Relevanssi is not indexing the Chinese posts..
    Any luck..

    1. If the Chinese text is in UTF-8, Relevanssi can read it and index it. However, Relevanssi simply does not work with Chinese or Japanese: these languages do not separate words in a way Relevanssi understands. Thus, even if you could index the contents, they wouldn’t make any sense. So unfortunately you have to forget about using Relevanssi with Chinese or Japanese.

  16. Dear Relevannsi Team,

    I am using your plugin and am happy so far. One question that came up is when looking at the search results page. That little “document” icon on the right of the search result, can this be deactivated. The user would arrive at the content page containing the seach term, clicking at the title of the page it was found on in the search results and via clicking this little icon. This are two links to the same and therefore might be a bit misleading. Can I deactivate that icon?

    Thank you for your excellent work and plugin.
    Best regards,

  17. Two questions.

    1. What is the latest version of PHP you are supporting?
    2. What is the correct format for ignoring shortcodes : basic or with all attributes e.g. [formidable] or [formidable id=”1″]?

    1. Stephen, any PHP 7 versions should be fine. Oldest we support is 5.6.

      Disable shortcodes using just the name of the shortcode, no attributes are necessary. It will disable all occasions, no matter the attributes.

  18. Thank you for the fast reply. I am using the download attachments plugin and for some reason that shortcode is not being ignored. The download attachments plugin has an issue with PHP 7.1+, but I am assuming that should not have an impact on indexing since it should not be rendering it at all. I setup a test site at to troubleshoot the issue if you want to see it.

  19. Hi there , I am using Relevanssi on my woocommerce website, I have enabled indexing product tags which it is doing fine the problem is it is reading space as a character like it gives 0 result for handmade but gives result for hand made which is a tag.
    Kindly reply if its a bug or am I missing some thing..

    Kind Regards

    1. Sana, “handmade” and “hand made” are two different things, and Relevanssi can’t tell they’re the same thing. Relevanssi doesn’t understand language. Add a synonym “handmade=hand made” in the Synonym tab.

  20. Hi,
    I’ve added Relevanssi to our e-com site, yet I do not see any products when searched (with exact product tags). The search only shows blog post results. What am I missing? Thanks.

  21. Hi Mikko, thanks for a great plugin! I have a site running on WPEngine and Relevanssi worked fine there since installing it in May. After updating the plugin to the latest version I get 502 bad gateway errors from every search. After disabling Relevanssi the search feature works as expected (but obviously search results are not as good as with Relevanssi enabled). Have you heard others on WPEngine reporting this? Would love to help fix this problem!

    1. Ville, no, this is the first complaint I’ve heard. What kind of settings you have, and how big is your database? 502 usually means the search is too heavy for the server.

      1. Found a possible issue after some debugging.

        The plugin seemed to crash in the Polylang compatibility filters (even though I don’t have Polylang installed). The real issue might still be related to WPEngine but after installing Polylang the search works again!

        I’m happy debug a bit more in order to find out the real issue but at least I can enable the plugin again.

        1. Polylang compatibility filters shouldn’t even load unless Polylang is installed. Does your site return true for function_exists('pll_get_post') when Polylang is not installed? If Polylang compatibility runs when Polylang is not installed, I’m not surprised there’s a crash.

          1. Found the real issue after more digging.

            The site used a theme that had some “helpful” Polylang fallbacks, just in case Polylang *isn’t* installed. Indeed the theme declares pll_get_post and some other Polylang functions if they don’t exist.

            Happy to say that Relevanssi has nothing to do with this, this was a problem with the theme.

  22. Hello, Relevanssi was working fine, but after WPENGINE CDN, stopped working. Is it due to CDN and cache, right now the intended search page doesn’t show when clicked on search

  23. Hi, Mikko

    I was just wondering if it’s possible to make Relevanssi show results only when the beginning of the word matches the search term?

    1. Algirdas, yes:

      add_filter( 'relevanssi_fuzzy_query', 'rlv_only_beginning' );
      function rlv_only_beginning( $query ) {
          return "(relevanssi.term LIKE '#term#%')";

      Add this to your theme functions.php.

  24. Is it possible to have more than one search on the same site using Relevanssi? We would like to have a site wide search and then on a calendar page have a search that would only return calendar items

    1. Yes, you can have as many different search forms as you want. On the Relevanssi settings page, click the “Help” button on the top right corner and see “Helpful shortcodes” there for a method of creating extra search forms that only target specific posts.

  25. If stopwords do not work because people are not looking for it – like the word Downloads (as we want to lead capture to those pages), but you have that keyword in a page title, can you exclude the page ID from search results somewhere?

    1. With Relevanssi Premium, you could just check the “Exclude this post” box on the post edit page. With the free version, list the page ID in the “Post exclusion” setting on the searching page.

  26. Hi Mikko
    First of all I would like to thank you for your plugin. It’s really helpful.
    I just have a concern regarding the searching logic, I see that the logic considers the weight based on the tf value calculated which reflects the number of times the word is mentioned in a post. This approach could cause some confusion when a sentence containing a keyword present in most of the articles as the weight will give priority to the posts containing this specific keyword more than other posts containing the whole sentence but the keywords are not repeated. For my case, I preferred to adjust the weight through the words mentioned rarely by dividing the weight by the $matches->count and the tf value to focus on the posts containing more words of the searched sentence.

    I did workaround on that through this function:

    function adjust_match_weights($match, $idf, $term ) {
    global $wpdb;
    $term_count = $wpdb->get_var(“SELECT COUNT(term) from wp_ecrs_relevanssi WHERE term = ‘$term'”);
    $match->weight = $match->weight / ($term_count * $match->tf);
    return $match;
    add_filter(‘relevanssi_match’,’adjust_match_weights’, 10, 3);

    It’s working fine. However I needed to add a separate query for each term through the loop to get the $matches->count value as the hook relevanssi_match doesn’t included. I don’t think this is the best practice due to increasing the database queries when $matches->count was already accessed before. It can even be used if I updated the core but not through accessing the relevanssi_match filter. Could the $matches object be included in the apply_filters function in a next update?

    Also regarding the synonyms, I noticed that if I added a synonym key and value it’s stored in the options table. However, if I came afterwards and wrote another synonym key and value it will overwrite the previous value in the database. I think that a simple concatenation function can solve this issue in the interface.php file.

    Is there a concern changing this line:
    $value = str_replace( $linefeeds, ‘;’, $_REQUEST[‘relevanssi_synonyms’] );

    To be that way?
    $value = get_options(‘relevanssi_synonyms’). “;”. str_replace( $linefeeds, ‘;’, $_REQUEST[‘relevanssi_synonyms’] );

    I tried it and it worked, however there are no filters here which means that I need to update it in the core. If I did so, I will need to change it every time I update the plugin. Couldn’t this be incorporated in a next update?


    1. Mohamed, I’m not really catching the reasoning behind your weighting suggestion. The TF × IDF weighting has been an industry standard for 60 years and for a good reason; it generally works really well. If you want to make a post with a smaller weight for a particular keyword rank higher for that keyword, the easiest solution would be just to pin it using the pinning feature in Relevanssi Premium: that will guarantee first ranking in the search, without any additional code.

      Your filter function is indeed not good for the performance: running all those extra queries will hurt the performance a lot. Why not use IDF instead? It’s already passed as the parameter to the filter, and while it’s not exactly the same as the term count you’re calculating, I think it’s generally the more useful number. Looking at the IDF is more helpful than the raw TF across the whole database, because the raw TF has no upper bound, while IDF has (the number of documents).

      Passing the $matches array as a parameter to the filter doesn’t help, because there’s no $matches->count value in it – Relevanssi doesn’t calculate the raw TF.

      Your suggested fix for the synonym interface would break it badly. Your change would make it impossible to ever remove synonyms, and the same synonyms would be duplicated many times every time the synonyms are saved. There’s no need to fetch the option value, because $_REQUEST['relevanssi_synonyms'] already includes all the synonyms, both old and new. If it doesn’t on your site, then there’s something wrong with the way your site works. It’s working as it is.

  27. Hello! I was wondering with stopwords, if there’s a way to customize the message displayed so that it doesn’t show “no results.” – Or can I at least do that within my search.php results page?

  28. Hi, was looking to purchase Relevanssi but need to check:

    1. Can the plugin only search a very specific part of our site (Q&A section). From what I have seen it looks like you can only specify whether pages or posts are searched, but not specific pages or posts or a specific section like our Q+A.

    2. Can we define our own keywords (tags), without Relevanssi generating any automatically? This is because we want to have a single tag word for each topic, which users might search for with acronyms or synonyms. E.g. the tag “Mayer-Rokitansky-Küster-Hauser syndrome (MRKH)” can be found with full term, or acronym – or plural or any other possible synonyms – and can we define these synonyms in connection with keywords? In this e.g.,”Uterine Agenesis” has the same meaning but may not be named as such.

    3. Can Relevanssi find search results for the keywords using our articles’ WordPress tags? I.e. an article we have tagged within WordPress as “Mayer-Rokitansky-Küster-Hauser syndrome (MRKH)” even if they don’t contain these terms.

    Any help or additional information would be much appreciated! Plugin looks really great!


    1. Chris, yes to all three! 1. is either very easy or slightly more complicated, depending on how the sections are set up. Limiting a search to a post type, category or certain page hierarchy is easy, for example.

      2. Relevanssi doesn’t generate any keywords or tags. By default Relevanssi indexes post titles and post content, and you can enable other stuff, but you can also disable content and title searching if you only want to search tags. You can add synonyms.

      3. Yes, Relevanssi can find posts by their tags, and can also find the tags themselves if you want to.

  29. Hi Mikko,

    Thank you for your last response , was very helpful. Just another quick couple questions, apologies if the answers are a bit obvious.

    Is there any documentation I could read through that might help me learn how to limit a search to a specific part in our site (Q&A section)?

    If we were then built the index, would it only index the terms in that specific part of the site (Q&A section)?

    Thank you for all your help.

    (I have attached a link to the section of the website incase that was useful)


    1. It all depends on how the Q&A section is defined. It looks like it’s a page, so are we talking about indexing a page and all it’s children pages? Just “Q&A Section” doesn’t mean anything, the only thing that matters is how it is implemented in WordPress terms.

      If you’re looking for indexing a page and its children, then you need to set up Relevanssi so that it only indexes pages. Then you need a filter on the relevanssi_do_not_index filter hook that will see if the page being indexed is a child of the Q&A page or not. Something like this:

      add_filter( 'relevanssi_do_not_index', 'rlv_only_qa_children', 10, 2 );
      function rlv_only_qa_children( $block, $post_id ) {
          $block = true;
          $parent = wp_get_post_parent_id( $post_id );
          if ( 123 === $parent || 123 === $post_id ) {
              $block = false;
          return $block;

      Just replace “123” with the post ID of the Q&A page, and this will only allow Relevanssi to index that page and its children.

  30. I have a submenu in a template row/column that appears on every page. If someone searches for a word that happens to appear in the submenu too, every page is listed in the search results. Is there anyway to ensure Relevanssi doesn’t list irrelevant pages by letting me force it to ignore certain div blocks on the page?

    For example, in the submenu, we have the word ‘Skincare’. If a user searches the word ‘Skincare’, even if a page has nothing to do with skincare (such as Digestive Health), it becomes listed.

    I hope my question makes sense.

    Best regards

    1. Joe, it’s possible; the menu is probably added as a shortcode to the page, and if you block that shortcode from Relevanssi indexing, it won’t be indexed. If you can tell me how the submenu is added to the page (ie. which shortcode is used), I can help to remove it.

  31. Just tracked down a (em) issue and wanted to report it. We have a few post titles that have (em) tags. When I searched for the exact title with quotation marks I was not getting any search results. When I searched for the exact title without quotation marks I did find it.

    Did a little digging and figured out that the (em) tag had to be added to the title in the search box when I was using quotation marks.

    For example:
    Does not work: “Preparing for inquiries generated by Instant Family”
    Works: “Preparing for inquiries generated by (em) Instant Family (em)”

    None of our users would know to do this (not sure how many even search with quotation marks) but this bug was reported to me so I had to track it down. Can this be fixed in a future release? Thanks!

    1. Tracy, it’s not really a bug, just a limitation in the search. When you do a phrase search with quotes, Relevanssi compares the search query against your database literally. If there’s a HTML tag in the text, it needs to be in the search query, otherwise there isn’t a match, because the search query doesn’t match the database literally.

      There are two solutions for this, but unfortunately neither of them is feasible. One would be to strip the HTML tags on the go, but that takes way too much time and slows down the search to a crawl. The other would be to save a copy of the post content without the HTML tags somewhere, but that requires too much space in the database.

      1. btw: could you allow or provide em and other highlighting code with a class? So I could use it elsewhere without further css hacks?

  32. Hi, I’m looking for a possibility to exclude text written in the header (logo claim) from search without including the search terms to stopp-words. Is there a way to exclude all content from the search that is not directly part of a page or post content?

  33. Hi, we have a retail site and use WooCommerce. The products sku and full product code are different – because there are often variations within each product. If you search the sku (also the same as the quickcode in most products), it shows search results. If you try and search the full product code (layout 123.456.789.123) nothing comes up, saying no product found to match.
    I’ve been through everything I can think of but still haven’t managed to make it search full product codes. At the minute the punctuation is set to remove.
    Can you help? Is this a limitation or am I just missing something obvious?

  34. Hi, The highlighting is not working. I want it highlight the keywords found in search.
    The options guide as this:
    Highlights in titles require changes to the search results template. You need to replace the_title() in the search results template with relevanssi_the_title().

    But I am not able to find the “the_title()”
    I have searched whole wordpress files but I can’t find that tag,

    Can you help me where I can change so it will work.


      1. I have the same issue and I’m using the Beaver Builder theme. Can’t find the_title() anywhere.

  35. I want to No Index my website Terms of Use page for the search engines but Index it in Relevanssi. When I add the No Index flag to the web page, it also becomes No Index for Relevanssi.
    Is there a way to force indexing in Relevanssi even though the search engine No Index flag is set for a page or post? Thanks.

      1. Yes, I am using Yoast SEO.
        Thank you for the quick reply and the link to the code change needed to disregard the Yoast SEO “noindex” setting.
        Best regards.

  36. Hi there,

    Does this plugin auto suggest words? For example, if I type in “Fo” could it show results for “Ford”?

    1. Bobby, Relevanssi doesn’t have auto suggest feature, but it has partial word matching. If you search for “For”, it will match posts that have the word “Ford”.

  37. Hi! I am using the Astra theme and Elementor Pro, which I created a Search Page template in. I clicked everything on the Index and built it, it says I have :

    41 documents in the index.
    3474 terms in the index.
    84 is the lowest post ID indexed.

    My site utilizes WordPress and WooCommerce. However, upon testing, the only search result I get back is the introductory post I’ve written, which was the issue before I uploaded Relevanssi as well. Furthermore, if I type in a random search term, it still pulls that same blog post, same as before, even though I know there is nothing about duck-billed platypuses on my site.

    Thanks for your help!

    1. Emily, the key here is the Search Page template: the Elementor Search Page templates are not compatible with Relevanssi. In order to be able to use Relevanssi, you need to use the plain WP search results template.

      If possible, please contact Elementor and let them know that you’d like to be able to use Relevanssi with the Elementor Search Page templates. That won’t be possible until the Elementor people figure out that’s what their users want and add support for Relevanssi.

      1. Did just that. After deactivating Relavanssi temporarily, I have the same issue. Something is up with Elementor, but it should definitely be compatible anyway! Thank you for your quick response. Stay healthy.

  38. I made a mistake when I upgraded from free to premium on my test site—I deleted free Relevanssi, then installed Premium. Lesson learned.

    But just to be clear, once I have installed Premium, *then* it’s okay to delete the free plugin, correct?

  39. I’ve just installed relevanssi on and basic search seems to work fine, the relevancy sort is great.

    However I can’t seem to get synonyms to work. I’m trying to get searches for personla to show results including personal so entered:

    personla =personal

    but searching for personla still returns no results. Searching for personal returns results.

    Any ideas?

    And is there any general library of US/UK spelling synonyms available?



    1. Looks like it’s working now, “personla” and “personal” return the same results. Were you perhaps using the AND search before? Synonyms require using the OR search.

      I don’t know of general US/UK spelling synonym libraries, but I don’t know if it’s that useful anyway. You know the key vocabulary used on your site, stick to those words. Random unrelated words aren’t that important. If you enable search logging, you can see the most common unsuccessful searches, which will give you a solid clue of what kind of words you need to focus on.

  40. Can Woocommerce products appear in order based on the individual item’s weight value which can be set manually?
    Possibly a custom field’s value that overrides everything else?


  41. Hi,
    I am trying to get Relevanssi to work with the divi theme on wordpress. I use the divi search module.

    This does not work. I added this code in my function.php of the child theme but the search results are only on the posts.
    add_action( ‘pre_get_posts’, function() {
    unset( $_GET[‘et_pb_searchform_submit’] );
    }, 1 );

    It’s very frustrating especially since I’ve just spent the day setting up the module and reading the docs.
    What am I doing wrong?
    Is there a special configuration? Can you please help me?

    1. Yes. You can use the relevanssi_valid_status filter hook to control which post statuses are included in the results. Note that Relevanssi should never show private posts in the results to users who can’t access them; if someone is seeing private posts they can’t access, something’s wrong.

  42. Hi Mikko,
    First of thanks for the awesome plugin and respect for the great job!

    I have 2 questions and I hope you can help 🙂

    I’m running a Woocommerce store. There are products available in different colors. The thing is, the search query I’d like to show results for, is included only in the image title of the product variation. For example “green chair” is included in the title of the image of a variation of a product with the title “A dining chair with wooden legs”.

    When the plugin is set to index “variations” it doesn’t return a result for that product at all because the title of the product doesn’t contain the query. When I include indexing of “attachments”, then results are returned, but if I have numerous product images in the main product gallery that include the search query in their names, the results include all of them which is user unfriendly.

    Is there a way I can set the search to return results only of images that are manually set for the product variations, but not all images in the product gallery that contain the search query? That would be the most clean and relevant result. Of course I don’t wish to exclude from results main product pages that contain the query in their titles.

    And one more question – I have thousands of attachments that are of assembly schemes that I don’t need to show in search results, but they include in their names different user queries and are shown on the results page. Is there a way to exclude such files? For example all those files include the word “scheme”. Can I exclude from results all files with “scheme” present in the title?


    1. Dave, the image shown on the search results page has nothing to do with Relevanssi; it’s up to the search results template in your theme. You can modify the template to control which images are shown. It’s somewhat tricky to make the search show the image of the matching variation; I don’t have a ready solution for that.

      Yes, you can exclude posts based on the title. See relevanssi_indexing_restriction for the best method.

  43. Sorry if this has been asked before… If I have multiple matches of my search terms in a post, is there any way I can have multiple snippets of the matches in my returned excerpt? (the_excerpt or relevanssi_the_excerpt). I seem to only get the first one…

Leave a Reply

Are you a Relevanssi Premium customer looking for support? Please use the Premium support form.

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