Continue reading MySQL server kills Relevanssi indexing

MySQL server kills Relevanssi indexing

A Relevanssi user reported a mystical database problem. After about two minutes of indexing, the server shuts down the indexing. This leaves MySQL queries hanging on the server, causing the site to crash. The only way to get the site back live was to reboot the whole MySQL server. Eventually, they were able to figure…

Read more MySQL server kills Relevanssi indexing 0 Comment on MySQL server kills Relevanssi indexing
Continue reading Adding custom functions to a site

Adding custom functions to a site

The Relevanssi knowledge base is full of code snippets and custom functions that you can use to enhance your site and to change how Relevanssi works. But where to place those snippets and functions? There are many different methods of adding custom functions to your site, and I will go through them in this article.…

Read more Adding custom functions to a site 4 Comments on Adding custom functions to a site
Continue reading Increasing weight for HTML tags

Increasing weight for HTML tags

Relevanssi ignores HTML tags when indexing posts. If you want to give more weight to words that appear in specific HTML tags (like headings), here is one way to do that. You can add this filter function on your site to the theme functions.php or in a code snippet: This code goes through the post…

Read more Increasing weight for HTML tags 0 Comment on Increasing weight for HTML tags
Continue reading Indexing image alt texts

Indexing image alt texts

Relevanssi by default ignores image alt texts (and other tag attributes). That’s often the right thing to do because alt texts aren’t visible to users. Finding a post with a search term that only appears in an alt text may confuse a user. If your alt texts are well crafted, they may help search. It’s…

Read more Indexing image alt texts 0 Comment on Indexing image alt texts
Continue reading Polylang attachment searching

Polylang attachment searching

If Polylang is in use and you haven’t enabled “Media translation“, your attachment files won’t have a language. That’s fine, except when Relevanssi searches fail to find your attachment because they’re looking for posts in a specific language. Suppose you want to include attachments in Polylang searches. In that case, you can either enable “Media…

Read more Polylang attachment searching 0 Comment on Polylang attachment searching
Continue reading Adding a search form in the navigation menu

Adding a search form in the navigation menu

WordPress doesn’t make adding a search form in the navigation menu easy. It’s a popular request, though, and having access to the search in the site header is typical. Relevanssi itself doesn’t have opinions on the user interface. Some themes, like Twenty Twenty, include a built-in search feature in the header. That’s a good reference…

Read more Adding a search form in the navigation menu 0 Comment on Adding a search form in the navigation menu
Continue reading Using Relevanssi in wp_link_query

Using Relevanssi in wp_link_query

If you want to use Relevanssi in the link queries (the search you get when adding links to posts in Classic editor), that’s easy. Make sure Relevanssi is enabled in admin searches, and then add this function: This function will make the Classic Editor link queries use Relevanssi. This approach generally works fine, but if…

Read more Using Relevanssi in wp_link_query 0 Comment on Using Relevanssi in wp_link_query
Continue reading CodeMirror Blocks

CodeMirror Blocks

CodeMirror Blocks is a good plugin for displaying good-looking code blocks in WordPress (you can see it in action right here on Relevanssi.com!). There’s a problem with Relevanssi in-document highlighting and the CodeMirror block, though: enabling the highlighting will break all CodeMirror blocks on the page, even if the highlighting happens outside the block. This…

Read more CodeMirror Blocks 0 Comment on CodeMirror Blocks