Skip to main contentSkip to footer

Relevanssi doesn’t by default index the headings in Visual Composer. The vcex_heading shortcode Visual Composer for the headings stores the heading text inside a shortcode attribute. By default, Relevanssi does not index shortcode attributes.

In this case, indexing the shortcode attribute is necessary. Fortunately, it’s easy to fix with a simple function added to your site:

add_filter( 'relevanssi_pre_excerpt_content', 'rlv_shortcode_attribute', 8 );
add_filter( 'relevanssi_post_content', 'rlv_shortcode_attribute', 8 );

function rlv_shortcode_attribute( $content ) {
	return preg_replace( '/\[vcex_heading.*?text="(.*?)".*?\]/im', '\1 ', $content );
}

After you add this function, rebuild the index. Now the headings are included in the index. This function is added to two hooks: relevanssi_pre_excerpt_content handles the excerpts and relevanssi_post_content the indexing.

Your account

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

Search

Popular Resources

Partial matches to just one custom field

…partial matches but only in the custom field ‘sku‘. * * For posts that have partial matches outside the custom field ‘sku‘, * set the weight to to eliminate them from the search results. * * @param object $match The match object with the custom field detail. * @param int……) ) { $match->weight = 0; } } return $match; } This requires Relevanssi Premium, because in the free version the customfield_detail field is not included in the $match object. (It’s possible to replicate the functionality by checking the sku custom field with get_post_meta( $match->doc, ‘sku‘, true ); but that…Is it possible to set (with filters and/or actions/functions) Relevanssi to use whole words keyword matching for post titles and 2 custom fields, and partial keyword matching only for a specific custom field (sku in this case)? Indeed it is! That is, you can’t set different keyword matching methods to…

Indexing post slugs
By default, Relevanssi does not index the post slug. It is, however, an easy thing to fix using the relevanssi_content_to_index…
Divi
Make Divi include all post types Divi search form module restricts the search to only posts and pages. To get…

Related Posts:

Comment Section:

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