Continue reading Premium 2.17 / Free 4.15

Premium 2.17 / Free 4.15

…in English, you can disable the translation updates with add_filter( ‘relevanssi_update_translations’, ‘__return_false’ );. Changed behaviour: Relevanssi now ignores WordPress metadata custom fields that aren’t interesting for Relevanssi indexing. Changed behaviour: Both relevanssi_get_permalink() and relevanssi_the_permalink() now can take post ID or a post object as a parameter and can thus be……/ 4.15.0 Premium. New feature: ‘Ignore post content’ checkbox in the Relevanssi post edit sidebar makes Relevanssi ignore post content for that post when indexing. New feature: The action hook relevanssi_init runs at the end of the relevanssi_init() function. Premium. New feature: The $post->relevanssi_hits data now includes more information about……custom field, taxonomy and MySQL column matches. New feature: New filter hook relevanssi_author_query_filter filters the post author MySQL query. New feature: New filter hook relevanssi_by_date_query_filter filters the by_date MySQL query. New feature: New filter hook relevanssi_date_query_filter filters the date query MySQL query. New feature: New filter hook relevanssi_parent_query_filter filters the…

Read more Premium 2.17 / Free 4.15 0 Comment on Premium 2.17 / Free 4.15
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

…to be conscious of theme updates. If you have a theme that gets updates, it’s not good to modify the functions.php file. Updates to the theme will overwrite your modifications, making you lose all functionality added to the file. In those cases, you need to use a child theme: the……child theme inherits everything from the parent theme, and you can safely make changes to the theme files in the child theme. Updates to the parent theme won’t overwrite the changes in the child theme. Creating child themes isn’t tricky, and some plugins help with the task. Custom plugin Another……approach is to create a custom plugin to store all the modifications. Creating a plugin requires slightly more setup work, but adding new functions is just as easy as with the functions.php method once you have the custom plugin. Using a plugin also has the added benefit of being independent…

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

…content inside those tags multiple times in the post content (as determined by the numbers in the $weightings array). This multiplication will increase the weight of those words in the Relevanssi index because Relevanssi counts how many times each word appears in each document. Thanks to Greg Perham from Swing…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: add_filter(……( < $weight– ) { $content .= ” $el_content”; } } } } return $content; } This code goes through the post content during the indexing with the relevanssi_post_content filter hook. When it finds content that appears inside the HTML tags specified in the $weightings array, it will add the…

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 translate” so that your media files have a language, or you can use this code in your theme functions.php to always include attachments in the results: add_filter( ‘relevanssi_where’, function( $query ) { global $wpdb; $query = str_replace( ‘AND relevanssi.doc’, ‘AND ( relevanssi.doc’, $query ); $query…

Read more Polylang attachment searching 0 Comment on Polylang attachment searching
Continue reading Premium 2.16 / Free 4.14

Premium 2.16 / Free 4.14

…Premium. Proximity sorting lets you sort posts by geographical distance. See the knowledge base for details on how this works. New filter hook relevanssi_render_blocks controls whether Relevanssi renders blocks in a post or not. If you are having problems updating long posts with lots of blocks, having this filter hook……search terms and multiline HTML tags. Click tracking codes are no longer added to URLs for non-logged users and bots. Image attachments could get indexed even when the indexing was blocked from the settings. 2.16.2 / 4.14.2 Removes unnecessary database calls from admin pages. Improves Oxygen compatibility. 2.16.1 / 4.14.1……return false for the post in question will likely help, as rendering the blocks in a long post can take huge amounts of memory. The searchform shortcode has a new parameter, post_type_boxes, which creates a checkbox for each post type you list in the value. For example [searchform post_type_boxes='*post,page'] would…

Read more Premium 2.16 / Free 4.14 0 Comment on Premium 2.16 / Free 4.14