Skip to main contentSkip to footer

Relevanssi Premium can index user profiles. Users may have meta fields attached to them: there’s a wp_usermeta database table, even though the user editing interface by default doesn’t have any tools to add meta fields to users.

Codex includes documentation on how to use the user meta fields. Read Working with User Metadata for code examples. I’m sure there are also plugins that can help with this.

Relevanssi settings page doesn’t contain a setting for indexing user meta fields. There’s, however, a hidden option you can use to index user custom fields. You can either set the option or use the pre_option_ filter hook to feed it.

Let’s say you want to index three custom fields: field_A, field_B and field_C. Add one of these functions to your site and rebuild the index to index the custom fields:

add_filter('pre_option_relevanssi_index_user_meta', 'rlv_index_user_meta_fields'); 
function rlv_index_user_meta_fields( $value ) { 
    return 'field_A,field_B,field_C';
}

or simply:

update_option( 'relevanssi_index_user_meta', 'field_A,field_B,field_C' );

Your account

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

Search

Popular Resources

Related Posts
Related posts are a popular feature, as it keeps the users engaged and offers them a new direction to continue…
Search is ignoring accents
In general, searches ignore accents, which is generally a good idea: for example in French, the difference between e and…
10Web Photo Gallery
The Photo Gallery plugin from 10Web uses a shortcode to add photo galleries to posts and pages. By default, Relevanssi…

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