Skip to main contentSkip to footer

By default posts imported with WP All Import do not get indexed by Relevanssi. The importing process does not trigger Relevanssi indexing. That is, however, easy to remedy:

add_action( 'pmxi_saved_post', 'post_saved', 10, 1 );
function post_saved( $id ) {
    relevanssi_index_doc( $id, true, relevanssi_get_custom_fields(), true );
}

Add this code to your site, and any posts imported with WP All Import will be indexed with Relevanssi. Do note that this will make the importing process run slower.

Your account

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

Search

Popular Resources

Controlling attachment types in index

Relevanssi lets you index attachments. But perhaps you only want to index a particular type of attachment? Relevanssi settings don’t have any control over that, it’s either all attachments or nothing. It is possible to choose which kinds of attachments are indexed. It is done with the relevanssi_indexing_restriction filter hook,…

Indexing private custom fields for admins only

…); function rlv_private_custom_fields( $match ) { global $wp_query; $admin_search = $wp_query->is_admin; if ( ! $admin_search && empty( $wp_query->query_vars ) ) { $admin_search = true; } if ( ! $admin_search ) { $customfield_detail = json_decode( $match->customfield_detail ); if ( isset( $customfield_detail->private_custom_field ) ) { $match->weight = 0; } if ( isset(…$customfield_detail->another_private_field ) ) { $match->weight = 0; } } return $match; } Now when a search is made on the front end and the custom field that has the hit matches one of the private fields, the post weight is set to zero. For  more sophistication, the code should probably…I use private custom fields. I want to index them in the administration but not on the public site. How to do ? Initially this seems impossible to do with Relevanssi, but it’s possible. Doing this requires Relevanssi Premium. The free version doesn’t know which custom field matches the search term,…

Related Posts:

Comment Section:

2 Comments. Leave new

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