The main customisation for Relevanssi Light is to add more content to the index. For custom fields, it’s easiest to use the relevanssi_light_custom_fields filter hook. Give the hook an array of custom field names, and the plugin will include the contents of those custom fields in the full-text index.
If you want to add more content, you may need to override the relevanssi_light_update_post_data() function. It’s pluggable so that you can override it from a must-use plugin. Here’s an example plugin that will include the post author’s name in the full-text index:
<?php
/**
* Plugin Name: Relevanssi Light Override
* Plugin URI: https://www.domain.com
* Description: Overrides Relevanssi Light post data update.
* Version: 1
* Author: Mikko Saari
* Author URI: https://www.relevanssi.com/
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
if ( ! function_exists( 'relevanssi_light_update_post_data' ) ) {
function relevanssi_light_update_post_data( $post_id ) {
global $wpdb;
// Fetch the author ID and use that to get the author name.
$author_id = (int) $wpdb->get_var(
$wpdb->prepare( "SELECT post_author FROM {$wpdb->posts} WHERE ID = %d ", $post_id )
);
$author_name = get_the_author_meta( 'display_name', $author_id );
// Update the post to add the author name to the relevanssi_light_data column.
$wpdb->update(
$wpdb->posts,
array( 'relevanssi_light_data' => $author_content ),
array( 'ID' => $post_id ),
array( '%s' ),
array( '%d' )
);
}
}
Save this as a file in the /wp-content/mu-plugins/ folder.
Not logged in. Log in to see your license details.
Relevanssi by default ignores image alt texts (and other tag attributes). That’s often the right thing to do because alt…
…} return $match; } Weight from tags Relevanssi Premium has a simple weight setting for adding weight to tags. If you want that in free Relevanssi, you have to use relevanssi_match to add extra weight to tags. add_filter( ‘relevanssi_match’, ‘rlv_boost_tags’ ); function rlv_boost_tags( $match ) { if ( $match->tag >……$title_boost + $match->content + $match->comment * $comment_boost + $match->tag * $tag_boost + $match->link * $link_boost + $match->author + $match->category + $match->excerpt + $match->taxonomy + $match->customfield; $match->weight = $match->tf * $idf; Where $idf is the inverse document frequency, aka the rarity of the term in question. The bigger the weight, the……taxonomy terms Weight from tags Weight from excerpts Weighing multisite subsites More weight for whole word matches Return only comments Weight based on parent Weight for featured images Boost matches from title beginning Performance issues Date-based weight Here’s an example function that will double the weight of posts published within…
Sometimes it can happen the search results include posts from a post type that has been excluded from the index. When that happens, here are things you can check. Are you using Relevanssi? It’s possible your search results are not coming from Relevanssi. The quickest way to check is to…
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | A New Chapter for Relevanssi | 0 | 10 | 27-03-2026 |
| 2 | A New Chapter for Relevanssi – Frontpage | 0 | 10 | 27-03-2026 |
| 3 | The wrong content gets indexed for a post | 0 | 6.22 | 27-01-2026 |
| 4 | Disabling Relevanssi Light for a specific post type | 0 | 9.04 | 20-04-2026 |
| 5 | Removing Relevanssi from the quick edit | 0 | 4.7 | 02-03-2026 |
| 6 | comesio solutions – The new home of Relevanssi | 0 | 10 | 27-03-2026 |
| 7 | Минфин настаивает на введении НДПИ на попутный газ | 0 | 0 | 19-02-2020 |
| 8 | LISTA: Talangerna som kan lyfta i Brynäs | 0 | 5 | 30-06-2026 |
| 9 | Uppmaningen till SHL och Hockeyallsvenskan | 0 | 10 | 28-06-2026 |
| 10 | ЦБ расширит ломбардный список | 0 | 0 | 03-04-2020 |