Continue reading Removing Relevanssi from the quick edit

Removing Relevanssi from the quick edit

…The option removes both, but there’s a solution. The quick edit features are added with the WordPress filter hook quick_edit_custom_box and can be removed by unhooking the Relevanssi function from that hook. You can do this with this little snippet: add_action( ‘init’, function() { remove_filter( ‘quick_edit_custom_box’, ‘relevanssi_quick_edit_custom_box’ ); }, 11);……Add this to your site, and the quick edit features will be gone. It’s important to wrap the remove_filter() in the init action, because otherwise this will have no effect if you put this code in your theme. Theme code runs before plugin code, so you’d first remove the filter……put this code in your theme. Theme code runs before plugin code, so you’d first remove the filter and then Relevanssi would add it. Relevanssi adds the filter in an init action on priority 10, so the priority 11 on init action is the first possible time to remove it….

Read more Removing Relevanssi from the quick edit 0 Comment on Removing Relevanssi from the quick edit
Continue reading The wrong content gets indexed for a post

The wrong content gets indexed for a post

Sometimes Relevanssi can get confused and indexes the post content under the wrong post ID. The main symptoms for this are: You can confirm this problem by checking the posts involved with the Relevanssi debugger that shows how Relevanssi has indexed the post. If you have this specific problem, you’ll find that the posts either…

Read more The wrong content gets indexed for a post 0 Comment on The wrong content gets indexed for a post
Continue reading Translation and multilingual plugins

Translation and multilingual plugins

Different translation plugins use different methods for storing the translations, and these methods have varying compatibility with how Relevanssi works with the posts. Best compatibility Polylang. Relevanssi has good built-in support for Polylang. This is the best translation tool that causes the least trouble. WPML. Good built-in support, almost as……are stored in a separate database, and are invisible for Relevanssi. It is possible to make Relevanssi index the translated strings, but then Relevanssi has no way to index different languages separately. You can’t restrict the search to a specific language; all languages are mixed together. GTranslate. The translations are……good as Polylang. WPML is more prone to causing weird edge case problems. MultilingualPress. Uses separate multisite sites for each language. This works well with Relevanssi, making language filtering automatic. With Relevanssi Premium, you can do multisite searching to include posts in different languages. Not compatible TranslatePress. The translated strings…

Read more Translation and multilingual plugins 0 Comment on Translation and multilingual plugins
Continue reading Disable in-page highlights on a specific page

Disable in-page highlights on a specific page

Sometimes there’s a need to disable the in-page highlighting on specific pages. Perhaps the feature works fine on most pages, but some pages have content that is broken by the highlighting. In theory, disabling the feature is very simple: remove the relevanssi_highlight_in_docs filter function from the the_content hook for that…

Read more Disable in-page highlights on a specific page 0 Comment on Disable in-page highlights on a specific page
Continue reading Debugging slow searches

Debugging slow searches

Reasonable expectations for Relevanssi searching speeds are measured in seconds. Relevanssi does not generally return results in milliseconds. On the other hand, the searches shouldn’t take more than few seconds in most cases. Multisite searches are a different thing: even if the searching is reasonably fast, searching across many sites will always be slow. Doing…

Read more Debugging slow searches 0 Comment on Debugging slow searches
Continue reading Indexing term descriptions for posts

Indexing term descriptions for posts

Sometimes it is helpful to have Relevanssi index the taxonomy term descriptions for posts. For example, the term description can be a good place to add alternate search terms for the term. By default, Relevanssi only indexes the term name, so you need extra code to get the term descriptions. The filter hook relevanssi_content_to_index is…

Read more Indexing term descriptions for posts 0 Comment on Indexing term descriptions for posts
Continue reading Problems with highlighting in post content

Problems with highlighting in post content

Versions 2.27.5 (Premium) and 4.24.4 (free) added extra security to highlighting search terms in post content. Before that, an attacker with contributor access could inject malicious content in the posts and the highlighting would then trigger that. This is now fixed, but the fix comes with a cost: the post content is passed through the…

Read more Problems with highlighting in post content 0 Comment on Problems with highlighting in post content
Continue reading Integrating Post Views Counter stats

Integrating Post Views Counter stats

…example, I have Kirjavinkit, a book review site with an archive of about 10,000 book review posts. The popularity of the posts is primarily driven by external search traffic and seems like a good indicator of what users find interesting and valuable. Integrating the Post Views Counter stats as a factor…

Read more Integrating Post Views Counter stats 0 Comment on Integrating Post Views Counter stats
Continue reading GeneratePress: Query Loop

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: Thanks to Ben Knowles. If you are using V2…

Read more GeneratePress: Query Loop 0 Comment on GeneratePress: Query Loop
Continue reading Year filter from the search query

Year filter from the search query

A good question was asked in the post Natural-language date queries: Is it possible to extend this so that I can simply add a the year in the search and only results from that year would show? The answer is yes! Add these functions to your site: The code consists of two functions. The first…

Read more Year filter from the search query 0 Comment on Year filter from the search query