Skip to main contentSkip to footer

Relevanssi adds a shortcode to help making links to search results. That way users can easily find more information about a given subject from your blog. The syntax is simple:

This will make the text John Doe a link to search results for John Doe. In case you want to link to some other search term than the anchor text (necessary in languages like Finnish), you can use:

Now the search will be for John Doe, but the anchor says Mr. John Doe.

One more parameter: setting  will wrap the search term in quotation marks, making it a phrase. This can be useful in some cases.

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

GeneratePress: Query Loop

Relevanssi doesn’t work automatically with the Query Loop block in GeneratePress and GenerateBlocks. Fortunately, the solution is simple: the Query Loop block has a filter hook for adjusting the query parameters, and you can use that filter hook to enable Relevanssi. Add this to your site: add_filter( ‘generateblocks_query_loop_args’, function( $query_args,…

Blocking pre and code tags
If your posts have lots of programming code examples in <pre> and <code> tags, those might look pretty bad in…

Related Posts:

Comment Section:

2 Comments. Leave new

  • There’s no automatic way to do it. Check the Relevanssi source code to see how the “User searches” page is made, you can see the MySQL code to get the most popular search terms.

    Reply
  • Is there a way to show search terms like the shortcode does but in the template?
    I want to display the 2 most popular search terms and while I cant find a way to do this automatically, if I can just show two terms in my template file that would work.

    Reply

Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed