Relevanssi icon
eCommerce & WooCommerce

Relevanssi hooks reference

  • By Christoph Vielgrader
  • v4.28.8
  • Updated

Relevanssi 4.28.8 has 13 actions and 172 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when Relevanssi fires an action
add_action( 'relevanssi_pre_indexing_query', function() {
	// Your code runs here.
}, 10, 1 );

// Change a value Relevanssi is about to use
add_filter( 'relevanssi_indexing_tokens', function( $relevanssi_tokenize, $arg2 ) {
	// Change $relevanssi_tokenize here.
	return $relevanssi_tokenize;
}, 10, 2 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • lib/compatibility/acf.php line 101 · used in 8 places
    /**
     * This filter is documented in lib/indexing.php
     */
    apply_filters( 'relevanssi_indexing_tokens', relevanssi_tokenize( $value, true, $min_word_length, 'indexing' ), 'custom_field' );
  • lib/sorting.php line 216 · used in 6 places
    /**
     * Adds in a missing sorting value.
     */
    apply_filters( 'relevanssi_missing_sort_key', $key1, $key );
  • lib/admin-ajax.php line 35 · used in 4 places
    /**
     * Filters the capability required to access Relevanssi options.
     */
    apply_filters( 'relevanssi_options_capability', 'manage_options' );
  • lib/utils.php line 935 · used in 3 places
    /**
     * This filter is documented in wp-includes/post-template.php
     */
    apply_filters( 'post_password_required', false, $post );
  • lib/admin-ajax.php line 189 · used in 2 places
    /**
     * Filters the capability required to access Relevanssi admin search page.
     */
    apply_filters( 'relevanssi_admin_search_capability', 'edit_posts' );
  • lib/search.php line 1278 · used in 2 places
    /**
     * Filters whether meta query can use REGEXP or NOT REGEXP comparison. This is
     * a potential blind oracle attack, so it's behind bars by default.
     */
    apply_filters( 'relevanssi_allow_meta_query_regexp', false );
  • lib/excerpts-highlights.php line 68 · used in 2 places
    /**
     * Allows creating one-letter highlights.
     */
    apply_filters( 'relevanssi_allow_one_letter_highlights', false );
  • lib/compatibility/gutenberg.php line 58 · used in 2 places
    /**
     * Filters the Gutenberg block before it is rendered.
     */
    apply_filters( 'relevanssi_block_to_render', $block );
  • lib/utils.php line 1720 · used in 2 places
    /**
     * Filters the bots Relevanssi should block from search queries.
     */
    apply_filters( 'relevanssi_bots_to_block', relevanssi_bot_block_list() );
  • lib/indexing.php line 1323 · used in 2 places
    /**
     * Filters the custom field value before indexing.
     */
    apply_filters( 'relevanssi_custom_field_value', get_post_meta( $post_id, $field, false ), $field, $post_id );
  • lib/search.php line 1604 · used in 2 places
    /**
     * Filters the DF query.
     */
    apply_filters( 'relevanssi_df_query_filter', $query );
  • lib/tabs/stopwords-tab.php line 58 · used in 2 places
    /**
     * Filters whether the common words list is displayed or not.
     */
    apply_filters( 'relevanssi_display_common_words', true );
  • lib/indexing.php line 139 · used in 2 places
    /**
     * Filters the WHERE restriction for indexing queries.
     */
    apply_filters( 'relevanssi_indexing_restriction', array( 'mysql' => $restriction, 'reason' => '', ) );
  • lib/search.php line 87 · used in 2 places
    /**
     * Filters the WP_Query object before Relevanssi.
     */
    apply_filters( 'relevanssi_modify_wp_query', $query );
  • lib/excerpts-highlights.php line 1057 · used in 2 places
    /**
     * Optimizes the excerpt creation.
     */
    apply_filters( 'relevanssi_optimize_excerpts', false );
  • lib/search.php line 1652 · used in 2 places
    /**
     * Filters the orderby parameter before Relevanssi sorts posts.
     */
    apply_filters( 'relevanssi_orderby', $orderby );
  • lib/search.php line 324 · used in 2 places
    /**
     * Filters whether the post can be shown to the user.
     */
    apply_filters( 'relevanssi_post_ok', $post_ok, $match->doc );
  • lib/indexing.php line 91 · used in 2 places
    /**
     * Allows actions to happen before the indexing query is run.
     */
    do_action( 'relevanssi_pre_indexing_query' );
  • lib/indexing.php line 1495 · used in 2 places
    /**
     * Filters whether stopwords should be removed from titles in tokenizing or
     * not.
     */
    apply_filters( 'relevanssi_remove_stopwords_in_titles', true );
  • lib/term-balance.php line 93 · used in 2 places
    /**
     * Filters the term-balance penalty exponent for this search execution.
     */
    apply_filters( 'relevanssi_term_balance_power', 0.0, $context );
  • lib/indexing.php line 267 · used in 2 places
    /**
     * Filters the valid status array.
     */
    apply_filters( 'relevanssi_valid_status', array( 'publish', 'draft', 'private', 'pending', 'future' ) );
  • the_category

    filter
    lib/class-relevanssi-taxonomy-walker.php line 64 · used in 2 places
    /**
     * This filter is documented in wp-includes/category-template.php
     */
    apply_filters( 'the_category', $category->name, '', '' );
  • lib/excerpts-highlights.php line 1407
    /**
     * Filters the accent replacement array.
     */
    apply_filters( 'relevanssi_accents_replacement_arrays', array( 'from' => array( 'a', 'c', 'e', 'i', 'o', 'u', 'n' ), 'to' => array( '(?:a|á|à|â)', '(?:c|ç)', '(?:e|é|è|ê|ë)', '(?:i|í|ì|î|ï)', '(?:o|ó|ò|ô|õ)', '(?:u|ú|ù|ü|û)', '(?:n|ñ)' ), 'from_re' => array( "/(s)('|’)?$/", "/[^\(\|:]('|’)/" ), 'to_re' => array( "(?:(?:'|’)?\\1|\\1(?:'|’)?)", "?('|’)?" ), ) );
  • lib/interface.php line 325
    /**
     * Filters the hooks where Relevanssi scripts are enqueued.
     */
    apply_filters( 'relevanssi_acceptable_hooks', $acceptable_hooks );
  • lib/compatibility/acf.php line 205
    /**
     * Filters the ACF field object.
     */
    apply_filters( 'relevanssi_acf_field_object', $field_object, $post_id );
  • lib/compatibility/acf.php line 90
    /**
     * Filters the field value before it is used to save the insert data.
     */
    apply_filters( 'relevanssi_acf_field_value', $field_object['choices'][ $field_value ], $field_name, $post_id );
  • lib/search.php line 708
    /**
     * If true, Relevanssi adds a list of all post IDs found in the query object in
     * $query->relevanssi_all_results.
     */
    apply_filters( 'relevanssi_add_all_results', false );
  • lib/common.php line 1131
    /**
     * Filters whether to add the highlight and tracking parameters to the link.
     */
    apply_filters( 'relevanssi_add_highlight_and_tracking', $add_highlight_and_tracking, $link_post );
  • lib/common.php line 1533
    /**
     * Filters the post types that are blocked in the admin search.
     */
    apply_filters( 'relevanssi_admin_search_blocked_post_types', $blocked_post_types );
  • lib/admin-ajax.php line 516
    /**
     * Filters the admin search results element.
     */
    apply_filters( 'relevanssi_admin_search_element', $post_element, $post );
  • lib/common.php line 548
    /**
     * Filters the admin search.
     */
    apply_filters( 'relevanssi_admin_search_ok', $admin_search_ok, $query );
  • lib/indexing.php line 642
    /**
     * Filters the number of queries returned.
     */
    apply_filters( 'relevanssi_after_index_doc_n', $n, $index_post, $remove_first, $custom_fields, $bypass_global_post, $debug );
  • lib/search-query-restrictions.php line 386
    /**
     * Filters the MySQL query for restricting the search by the post author.
     */
    apply_filters( 'relevanssi_author_query_filter', $query_restrictions, $author );
  • lib/search.php line 861
    /**
     * Allows the use of one letter search terms.
     */
    apply_filters( 'relevanssi_block_one_letter_searches', true );
  • lib/compatibility/acf.php line 165
    /**
     * Filters the types of ACF fields to exclude from indexing.
     */
    apply_filters( 'relevanssi_blocked_field_types', array( 'repeater', 'flexible_content', 'group' ) );
  • lib/search-query-restrictions.php line 444
    /**
     * Filters the MySQL query for restricting the search by the by_date.
     */
    apply_filters( 'relevanssi_by_date_query_filter', $query_restrictions, $by_date );
  • lib/common.php line 315
    /**
     * Filters each post object Relevanssi caches.
     */
    apply_filters( 'relevanssi_cached_post_object', $post );
  • lib/excerpts-highlights.php line 821
    /**
     * Allows cleaning unwanted highlights.
     */
    apply_filters( 'relevanssi_clean_excerpt', $content, $start_emp_token, $end_emp_token );
  • lib/indexing.php line 1060
    /**
     * Filters the comment author before indexing.
     */
    apply_filters( 'relevanssi_comment_author_to_index', $comment->comment_author, $comment->comment_ID );
  • lib/indexing.php line 1067
    /**
     * Filters the comment content before indexing.
     */
    apply_filters( 'relevanssi_comment_content_to_index', $comment->comment_content, $comment->comment_ID );
  • lib/sorting.php line 351
    /**
     * Provides the sorting order for the filter.
     */
    apply_filters( 'relevanssi_comparison_order', array() );
  • lib/indexing.php line 1573
    /**
     * Can be used to add extra content to the post before indexing.
     */
    apply_filters( 'relevanssi_content_to_index', '', $post_object );
  • lib/init.php line 468
    /**
     * Allows adding database tables.
     */
    do_action( 'relevanssi_create_tables', $charset_collate );
  • lib/search-query-restrictions.php line 306
    /**
     * Filters the MySQL query for restricting the search by the date_query.
     */
    apply_filters( 'relevanssi_date_query_filter', $query_restrictions, $date_query );
  • lib/search-query-restrictions.php line 289
    /**
     * If true, include non-posts (users, terms) in searches with a date query
     * filter.
     */
    apply_filters( 'relevanssi_date_query_non_posts', false );
  • lib/common.php line 473
    /**
     * Filters the default punctuation replacement value.
     */
    apply_filters( 'relevanssi_default_punctuation_replacement', ' ' );
  • lib/search.php line 935
    /**
     * Filters the default tax_query relation.
     */
    apply_filters( 'relevanssi_default_tax_query_relation', 'AND' );
  • lib/didyoumean.php line 150
    /**
     * Filters the MySQL query used to fetch potential suggestions from the log.
     */
    apply_filters( 'relevanssi_didyoumean_query', $q );
  • lib/didyoumean.php line 102
    /**
     * Filters the complete 'Did you mean' suggestion.
     */
    apply_filters( 'relevanssi_didyoumean_suggestion', "$pre<a href='$url'>$suggestion</a>$post" );
  • lib/didyoumean.php line 176
    /**
     * Filters the tokens for Did you mean suggestions.
     */
    apply_filters( 'relevanssi_didyoumean_token', trim( $token ) );
  • lib/didyoumean.php line 87
    /**
     * Filters the 'Did you mean' suggestion URL.
     */
    apply_filters( 'relevanssi_didyoumean_url', $url, $query, $suggestion );
  • lib/excerpts-highlights.php line 105
    /**
     * Filters the excerpt-building problem shortcodes.
     */
    apply_filters( 'relevanssi_disable_shortcodes_excerpt', $problem_shortcodes );
  • lib/common.php line 656
    /**
     * Disables stopwords completely.
     */
    apply_filters( 'relevanssi_disable_stopwords', false );
  • lib/indexing.php line 1707
    /**
     * Filters the shortcodes Relevanssi disables while indexing posts.
     */
    apply_filters( 'relevanssi_disabled_shortcodes', array_unique( array_merge( $shortcodes, $default_disables ) ) );
  • lib/indexing.php line 513
    /**
     * Filters whether a post is indexed or not.
     */
    apply_filters( 'relevanssi_do_not_index', false, $post->ID, $post );
  • lib/excerpts-highlights.php line 283
    /**
     * Filters the ellipsis Relevanssi uses in excerpts.
     */
    apply_filters( 'relevanssi_ellipsis', '...' );
  • lib/excerpts-highlights.php line 943
    /**
     * Choose whether htmlentities() is run inside <code> tags or not. If your
     * pages have HTML code inside <code> tags, set this to false.
     */
    apply_filters( 'relevanssi_entities_inside_code', true );
  • lib/excerpts-highlights.php line 933
    /**
     * Choose whether htmlentities() is run inside <pre> tags or not. If your pages
     * have HTML code inside <pre> tags, set this to false.
     */
    apply_filters( 'relevanssi_entities_inside_pre', true );
  • lib/search.php line 2100
    /**
     * Filters the exact match bonus.
     */
    apply_filters( 'relevanssi_exact_match_bonus', array( 'title' => 5, 'content' => 2, ) );
  • lib/excerpts-highlights.php line 305
    /**
     * Filters excerpt text.
     */
    apply_filters( 'relevanssi_excerpt', $excerpt['text'], $post->ID );
  • lib/excerpts-highlights.php line 157
    /**
     * Filters the post content after 'the_content'.
     */
    apply_filters( 'relevanssi_excerpt_content', $content, $post, $query );
  • lib/excerpts-highlights.php line 1535
    /**
     * Filters the custom field content for excerpt use.
     */
    apply_filters( 'relevanssi_excerpt_custom_field_content', $custom_field_string, $post_id, $custom_fields );
  • lib/excerpts-highlights.php line 1471
    /**
     * Filters the list of custom fields used for the excerpt.
     */
    apply_filters( 'relevanssi_excerpt_custom_fields', $custom_fields, $post_id );
  • lib/excerpts-highlights.php line 1274
    /**
     * Adjusts the gap between excerpt candidates.
     */
    apply_filters( 'relevanssi_excerpt_gap', floor( $count_words / 200 - $excerpt_length ), $count_words, $excerpt_length );
  • lib/excerpts-highlights.php line 344
    /**
     * Filters individual excerpt parts.
     */
    apply_filters( 'relevanssi_excerpt_part', '<span class="excerpt_part">' . $excerpt['text'] . '</span>', $excerpt, $post->ID );
  • lib/excerpts-highlights.php line 1660
    /**
     * Filters whether an excerpt should be added to a post or not.
     */
    apply_filters( 'relevanssi_excerpt_post', true, $post, $query );
  • lib/excerpts-highlights.php line 60
    /**
     * Filters the search query before excerpt-building.
     */
    apply_filters( 'relevanssi_excerpt_query', $query );
  • lib/excerpts-highlights.php line 1552
    /**
     * Filters the custom field content for excerpt use.
     */
    apply_filters( 'relevanssi_excerpt_specific_custom_field_content', $custom_field_content, $post_id );
  • lib/search.php line 490
    /**
     * Filters the fallback search parameters.
     */
    apply_filters( 'relevanssi_fallback', $params );
  • lib/common.php line 1267
    /**
     * Filters the list of post types Relevanssi does not want to use.
     */
    apply_filters( 'relevanssi_forbidden_post_types', array( 'wp_template_part', 'wp_global_styles', 'wp_navigation', 'nav_menu_item', 'revision', 'acf', 'acf-field', 'acf-field-group', 'acf-taxonomy', 'acf-post-type', 'acf-ui-options-page', 'oembed_cache', 'customize_changeset', 'user_request', 'custom_css', 'cpt_staff_lst_item', 'cpt_staff_lst', 'wp_block', 'amp_validated_url', 'jp_pay_order', 'jp_pay_product', 'jp_mem_plan', 'tablepress_table',... );
  • lib/common.php line 1389
    /**
     * Filters the list of taxonomies Relevanssi does not want to use.
     */
    apply_filters( 'relevanssi_forbidden_taxonomies', array( 'wp_template_part_area', 'nav_menu', 'link_category', 'amp_validation_error', 'product_visibility', 'wpforms_log_type', 'amp_template', 'edd_commission_status', 'edd_log_type', 'elementor_library_type', 'elementor_library_category', 'elementor_font_type', 'wp_theme', 'fl-builder-template-category', 'fl-builder-template-type', 'wp_pattern_category', 'wpforms_form_tag', ) );
  • lib/search.php line 835
    /**
     * Filters the partial matching search query.
     */
    apply_filters( 'relevanssi_fuzzy_query', "(relevanssi.term LIKE '#term#%' OR relevanssi.term_reverse LIKE CONCAT(REVERSE('#term#'), '%')) ", $term );
  • lib/indexing.php line 1045
    /**
     * Filters the arguments for get_approved_comments().
     */
    apply_filters( 'relevanssi_get_approved_comments_args', $args );
  • lib/didyoumean.php line 138
    /**
     * The minimum limit of occurrances to include a word.
     */
    apply_filters( 'relevanssi_get_words_having', 2 );
  • lib/excerpts-highlights.php line 622
    /**
     * Filters the query during highlighting before tokenizing it.
     */
    apply_filters( 'relevanssi_highlight_query', $query );
  • lib/excerpts-highlights.php line 731
    /**
     * Filters the regular expression used for highlighting.
     */
    apply_filters( 'relevanssi_highlight_regex', $regex, $pr_term );
  • lib/excerpts-highlights.php line 611
    /**
     * Runs before tokenizing the terms in highlighting.
     */
    do_action( 'relevanssi_highlight_tokenize' );
  • lib/search.php line 613
    /**
     * Filters the founds results.
     */
    apply_filters( 'relevanssi_hits_filter', $filter_data, $query );
  • lib/search.php line 681
    /**
     * Filters the displayed hits.
     */
    apply_filters( 'relevanssi_hits_to_show', $hits_to_show, $query );
  • lib/indexing.php line 790
    /**
     * Filters the attachment and revision post types.
     */
    apply_filters( 'relevanssi_index_attachment_revision_types', array( 'attachment', 'revision' ) );
  • lib/indexing.php line 1010
    /**
     * If this filter returns true, the comments for the post are not indexed.
     */
    apply_filters( 'relevanssi_index_comments_exclude', false, $post_id );
  • lib/indexing.php line 1539
    /**
     * If this filter returns false, post content is not indexed at all.
     */
    apply_filters( 'relevanssi_index_content', true, $post_object );
  • lib/common.php line 1779
    /**
     * Filters the list of custom fields to index before indexing.
     */
    apply_filters( 'relevanssi_index_custom_fields', $custom_fields, $post_id );
  • lib/indexing.php line 1416
    /**
     * If this filter returns false, post excerpt is not indexed at all.
     */
    apply_filters( 'relevanssi_index_excerpt', true, $post_object );
  • lib/indexing.php line 1754
    /**
     * Sets the indexed post 'type' column in the index.
     */
    apply_filters( 'relevanssi_index_get_post_type', 'post', $post );
  • lib/indexing.php line 1464
    /**
     * If this filter returns false, titles are not indexed at all.
     */
    apply_filters( 'relevanssi_index_titles', true, $post_object );
  • lib/interface.php line 423
    /**
     * Sets the indexing adjustment.
     */
    apply_filters( 'relevanssi_indexing_adjust', true );
  • lib/indexing.php line 1762
    /**
     * Filters the indexing data before it is converted to INSERT queries.
     */
    apply_filters( 'relevanssi_indexing_data', $insert_data, $post );
  • lib/interface.php line 410
    /**
     * Sets the indexing limit, ie. how many posts are indexed at once.
     */
    apply_filters( 'relevanssi_indexing_limit', 10 );
  • lib/indexing.php line 201
    /**
     * Filters the Relevanssi indexing query.
     */
    apply_filters( 'relevanssi_indexing_query', $q );
  • lib/indexing.php line 1818
    /**
     * Filters the INSERT query VALUES sections before they are inserted in the
     * INSERT query.
     */
    apply_filters( 'relevanssi_indexing_values', $values, $post );
  • lib/search.php line 202
    /**
     * Filters the meta query JOIN for the Relevanssi search query.
     */
    apply_filters( 'relevanssi_join', $query_join );
  • lib/log.php line 38
    /**
     * Filters the current user for logs.
     */
    apply_filters( 'relevanssi_log_get_user', wp_get_current_user() );
  • lib/search.php line 645
    /**
     * Filters the query.
     */
    apply_filters( 'relevanssi_log_query', $q_no_synonyms, $q, $query );
  • lib/search.php line 307
    /**
     * Filters the Relevanssi post matches.
     */
    apply_filters( 'relevanssi_match', $match, $idf, $term );
  • lib/common.php line 146
    /**
     * Determines the tag used for missing terms, default <s>.
     */
    apply_filters( 'relevanssi_missing_terms_tag', 's' );
  • lib/common.php line 160
    /**
     * Filters the template for showing missing terms. Make sure you include the
     * '%s', as that is where the missing terms will be inserted.
     */
    apply_filters( 'relevanssi_missing_terms_template', '<span class="missing_terms">' . __( 'Missing', 'relevanssi' ) . ': %s</span>' );
  • lib/modal-search.php line 149
    /**
     * Filters the modal search arguments.
     */
    apply_filters( 'relevanssi_modal_search_args', $args, $defaults );
  • lib/modal-search.php line 290
    /**
     * Filters the modal search dialog HTML code.
     */
    apply_filters( 'relevanssi_modal_search_dialog_html', $dialog, $args, $form_args );
  • lib/modal-search.php line 159
    /**
     * Filters the modal search form arguments.
     */
    apply_filters( 'relevanssi_modal_search_form_args', $form, $modal );
  • lib/modal-search.php line 192
    /**
     * Filters the modal search trigger and dialog HTML code.
     */
    apply_filters( 'relevanssi_modal_search_html', $markup, $modal, $form );
  • lib/modal-search.php line 346
    /**
     * Filters whether modal search styles are loaded in the page head.
     */
    apply_filters( 'relevanssi_modal_search_preload_style', $should_preload, $post );
  • lib/modal-search.php line 239
    /**
     * Filters the CSS classes on a modal search trigger button.
     */
    apply_filters( 'relevanssi_modal_search_trigger_classes', $classes, $args );
  • lib/modal-search.php line 259
    /**
     * Filters the HTML code for the modal search trigger button.
     */
    apply_filters( 'relevanssi_modal_search_trigger_html', $trigger, $args );
  • lib/log.php line 78
    /**
     * Filters whether a query should be logged or not.
     */
    apply_filters( 'relevanssi_ok_to_log', true, $query, $hits, $user_agent, $ip, $source );
  • lib/search.php line 1682
    /**
     * Filters the order parameter before Relevanssi sorts posts.
     */
    apply_filters( 'relevanssi_order', $order );
  • lib/compatibility/oxygen.php line 160
    /**
     * Filters the Oxygen JSON child element.
     */
    apply_filters( 'relevanssi_oxygen_element', $child );
  • lib/compatibility/oxygen.php line 123
    /**
     * Filters the Oxygen Builder section content before the Oxygen Builder
     * shortcode tags are removed.
     */
    apply_filters( 'relevanssi_oxygen_section_content', $content, $post_id );
  • lib/compatibility/oxygen.php line 92
    /**
     * Allows defining filters to remove Oxygen Builder sections.
     */
    apply_filters( 'relevanssi_oxygen_section_filters', array() );
  • lib/common.php line 1474
    /**
     * Filters the page builder shortcode.
     */
    apply_filters( 'relevanssi_page_builder_shortcodes', array( '/\[et_pb_code.*?\].*?\[\/et_pb_code\]/im', '/\[et_pb_sidebar.*?\].*?\[\/et_pb_sidebar\]/im', '/\[et_pb_fullwidth_slider.*?\].*?\[\/et_pb_fullwidth_slider\]/im', '/\[et_pb_fullwidth_code.*?\].*?\[\/et_pb_fullwidth_code\]/im', '/\[vc_raw_html.*?\].*?\[\/vc_raw_html\]/im', '/\[fusion_imageframe.*?\].*?\[\/fusion_imageframe\]/im', '/\[fusion_code.*?\].*?\[\/fusion_code\]/im', '/\[\/?et_pb.*... );
  • lib/search-query-restrictions.php line 220
    /**
     * Filters the MySQL query for restricting the search by the post parent.
     */
    apply_filters( 'relevanssi_parent_query_filter', $query_restrictions, $parent_query );
  • lib/phrases.php line 214
    /**
     * Filters each phrase before it's passed through esc_sql() and used in the
     * MySQL query. You can use this filter hook to for example run htmlentities()
     * on the phrase in case your database needs that.
     */
    apply_filters( 'relevanssi_phrase', $phrase );
  • lib/phrases.php line 94
    /**
     * Filters the custom fields for phrase matching.
     */
    apply_filters( 'relevanssi_phrase_custom_fields', relevanssi_get_custom_fields() );
  • lib/phrases.php line 303
    /**
     * Filters the phrase queries.
     */
    apply_filters( 'relevanssi_phrase_queries', $queries, $phrase, $status );
  • lib/common.php line 895
    /**
     * Controls how synonyms are handled when they appear inside phrases.
     */
    apply_filters( 'relevanssi_phrase_synonyms', true );
  • lib/phrases.php line 104
    /**
     * Filters the taxonomies for phrase matching.
     */
    apply_filters( 'relevanssi_phrase_taxonomies', get_option( 'relevanssi_index_taxonomies_list', array() ) );
  • lib/indexing.php line 1268
    /**
     * Filters the post author display_name before indexing it.
     */
    apply_filters( 'relevanssi_post_author', $display_name, $post );
  • lib/indexing.php line 1560
    /**
     * Filters the post content before indexing.
     */
    apply_filters( 'relevanssi_post_content', $post_object->post_content, $post_object );
  • lib/indexing.php line 1593
    /**
     * Filters the post content after shortcodes but before HTML stripping.
     */
    apply_filters( 'relevanssi_post_content_after_shortcodes', $contents, $post_object );
  • lib/indexing.php line 1614
    /**
     * Filters the post content in indexing before tokenization.
     */
    apply_filters( 'relevanssi_post_content_before_tokenize', $contents, $post_object );
  • lib/search-query-restrictions.php line 162
    /**
     * Filters the MySQL query for restricting the search by post parameters.
     */
    apply_filters( 'relevanssi_post_query_filter', $query_restrictions, $post_query );
  • lib/search-query-restrictions.php line 611
    /**
     * Filters the MySQL query for restricting the search by the post status.
     */
    apply_filters( 'relevanssi_post_status_query_filter', $query_restrictions, $post_status );
  • lib/excerpts-highlights.php line 145
    /**
     * Runs after Relevanssi excerpt building applies `the_content`.
     */
    do_action( 'relevanssi_post_the_content' );
  • lib/indexing.php line 1483
    /**
     * Filters the title before tokenizing and indexing.
     */
    apply_filters( 'relevanssi_post_title_before_tokenize', $filtered_title, $post_object );
  • lib/excerpts-highlights.php line 47
    /**
     * Allows filtering the indexed post before building an excerpt from it.
     */
    apply_filters( 'relevanssi_post_to_excerpt', $t_post );
  • lib/indexing.php line 555
    /**
     * Allows filtering the indexed post before indexing.
     */
    apply_filters( 'relevanssi_post_to_index', $post, $post );
  • lib/search-query-restrictions.php line 552
    /**
     * Filters the MySQL query for restricting the search by the post type.
     */
    apply_filters( 'relevanssi_post_type_query_filter', $query_restrictions, $post_type, $include_attachments, $admin_search );
  • lib/excerpts-highlights.php line 118
    /**
     * Filters the post content before 'the_content'.
     */
    apply_filters( 'relevanssi_pre_excerpt_content', $post->post_content, $post, $query );
  • lib/excerpts-highlights.php line 137
    /**
     * Runs before Relevanssi excerpt building applies `the_content`.
     */
    do_action( 'relevanssi_pre_the_content' );
  • lib/common.php line 701
    /**
     * Fires Premium tokenizer.
     */
    apply_filters( 'relevanssi_premium_tokenizer', $token, $context );
  • lib/common.php line 560
    /**
     * Filters whether the default request is blocked or not.
     */
    apply_filters( 'relevanssi_prevent_default_request', $prevent, $query );
  • lib/common.php line 454
    /**
     * Filters the punctuation replacement array.
     */
    apply_filters( 'relevanssi_punctuation_filter', $replacement_array );
  • lib/utils.php line 1047
    /**
     * Filters the list of allowed query arguments.
     */
    apply_filters( 'relevanssi_query_arg_allowlist', $args_allowlist );
  • lib/search.php line 1769
    /**
     * Filters the Relevanssi search query.
     */
    apply_filters( 'relevanssi_query_filter', $query );
  • lib/log.php line 59
    /**
     * Filters the IP address of the searcher.
     */
    apply_filters( 'relevanssi_remote_addr', $_SERVER['REMOTE_ADDR'] );
  • lib/common.php line 673
    /**
     * Removes punctuation from the string.
     */
    apply_filters( 'relevanssi_remove_punctuation', $str );
  • lib/compatibility/gutenberg.php line 40
    /**
     * Filters whether the blocks are rendered or not.
     */
    apply_filters( 'relevanssi_render_blocks', true, $post_object );
  • lib/compatibility/gutenberg.php line 97
    /**
     * Filters the Gutenberg block after it is rendered.
     */
    apply_filters( 'relevanssi_rendered_block', render_block( $block ), $block );
  • lib/search.php line 418
    /**
     * Filters the results Relevanssi finds.
     */
    apply_filters( 'relevanssi_results', $doc_weight, $q, $scoring_context );
  • lib/search.php line 370
    /**
     * Filters the parameters for fallback search.
     */
    apply_filters( 'relevanssi_search_again', $params );
  • lib/search.php line 125
    /**
     * Filters the search parameters.
     */
    apply_filters( 'relevanssi_search_filters', $args );
  • lib/shortcodes.php line 272
    /**
     * Filters the Relevanssi shortcode search form before it's used.
     */
    apply_filters( 'relevanssi_search_form', $form, $atts );
  • lib/search.php line 70
    /**
     * Filters whether Relevanssi search can be run or not.
     */
    apply_filters( 'relevanssi_search_ok', $search_ok, $query );
  • lib/search.php line 1134
    /**
     * Filters the Relevanssi search parameters after compiling.
     */
    apply_filters( 'relevanssi_search_params', $search_params, $query );
  • lib/shortcodes.php line 208
    /**
     * Filters the arguments for the Relevanssi search form taxonomy dropdowns.
     */
    apply_filters( 'relevanssi_searchform_dropdown_args', $args );
  • lib/settings/infrastructure/class-relevanssi-setting-field-factory.php line 73
    /**
     * Filters the resolved class name for a given settings field type.
     */
    apply_filters( "relevanssi_setting_field_class_{$type}", self::$registry[ $type ] ?? null );
  • lib/common.php line 123
    /**
     * Filters the search result breakdown.
     */
    apply_filters( 'relevanssi_show_matches', $result, $post );
  • lib/common.php line 210
    /**
     * Filters whether password protected posts are shown in the search results.
     */
    apply_filters( 'relevanssi_show_password_protected', false, $post_id );
  • lib/sorting.php line 112
    /**
     * Lets you choose the compare method for fields.
     */
    apply_filters( 'relevanssi_sort_compare', $compare, $key );
  • lib/interface.php line 240
    /**
     * Allows adding new tabs to the Relevanssi menu.
     */
    apply_filters( 'relevanssi_tabs', $tabs );
  • lib/indexing.php line 704
    /**
     * Filters the taxonomy term content before indexing.
     */
    apply_filters( 'relevanssi_tag_before_tokenize', trim( $term_string ), $post_taxonomy_terms, $taxonomy, $post_id );
  • lib/search.php line 882
    /**
     * Filters the term WHERE condition for the Relevanssi MySQL query.
     */
    apply_filters( 'relevanssi_term_where', $term_where, $term );
  • lib/indexing.php line 1093
    /**
     * Filters the TRUNCATE TABLE query for truncating the index.
     */
    apply_filters( 'relevanssi_truncate_index', "TRUNCATE TABLE $relevanssi_table" );
  • lib/install.php line 147
    /**
     * Runs after Relevanssi options are added in the installation process.
     */
    do_action( 'relevanssi_update_options' );
  • lib/init.php line 232
    /**
     * Filters the capability required to access Relevanssi user searches page.
     */
    apply_filters( 'relevanssi_user_searches_capability', 'edit_pages' );
  • lib/user-searches.php line 358
    /**
     * Filters the number of most common queries to show.
     */
    apply_filters( 'relevanssi_user_searches_limit', 100 );
  • lib/user-searches.php line 474
    /**
     * Filters the query URL for the user searches page.
     */
    apply_filters( 'relevanssi_user_searches_query_url', $url . '/?s=' . $search_parameter );
  • lib/common.php line 250
    /**
     * Filters statuses allowed in admin searches.
     */
    apply_filters( 'relevanssi_valid_admin_status', array( 'draft', 'pending', 'future' ) );
  • lib/utils.php line 261
    /**
     * Controls whether the week starts on Sunday or Monday.
     */
    apply_filters( 'relevanssi_week_starts_on_sunday', false );
  • lib/search.php line 190
    /**
     * Filters the query restrictions for the Relevanssi query.
     */
    apply_filters( 'relevanssi_where', $query_restrictions );
  • lib/compatibility/woocommerce.php line 84
    /**
     * Controls the WooCommerce product visibility filtering.
     */
    apply_filters( 'relevanssi_woocommerce_indexing', $woocommerce_blocks );
  • the_content

    filter
    lib/excerpts-highlights.php line 140
    /**
     * This filter is documented in wp-includes/post-template.php
     */
    apply_filters( 'the_content', $content );
  • the_title

    filter
    lib/indexing.php line 1472
    /**
     * This filter is documented in wp-includes/post-template.php
     */
    apply_filters( 'the_title', $post_object->post_title, $post_object->ID );
  • lib/compatibility/wpml.php line 65 · used in 3 places
    apply_filters( 'wpml_object_id', $hit->ID, $hit->post_type, $fallback_to_default );
  • lib/search.php line 161 · used in 2 places
    do_action( 'relevanssi_disable_stemmer' );
  • lib/search.php line 163 · used in 2 places
    do_action( 'relevanssi_enable_stemmer' );
  • lib/utils.php line 448 · used in 2 places
    apply_filters( 'wpml_current_language', null );
  • lib/compatibility/wpml.php line 125 · used in 2 places
    apply_filters( 'wpml_post_language_details', null, $post_id );
  • wpml_setting

    filter
    lib/compatibility/wpml.php line 34 · used in 2 places
    apply_filters( 'wpml_setting', false, 'custom_posts_sync_option' );
  • lib/tabs/indexing-tab.php line 480
    apply_filters( 'relevanssi_advanced_indexing_config', $advanced_config );
  • lib/tabs/indexing-tab.php line 693
    do_action( 'relevanssi_advanced_indexing_sidebar_list' );
  • lib/tabs/admin-dev-tab.php line 457
    do_action( 'relevanssi_debugging_tab_content' );
  • lib/tabs/searching-tab.php line 139
    apply_filters( 'relevanssi_form_did_you_mean', $basic_search_config );
  • lib/tabs/searching-tab.php line 292
    apply_filters( 'relevanssi_form_recency_cutoff', $weights_config );
  • lib/options.php line 45
    do_action( 'relevanssi_indexing_options', $request );
  • lib/tabs/indexing-tab.php line 681
    do_action( 'relevanssi_indexing_tab_advanced' );
  • lib/init.php line 170
    do_action( 'relevanssi_init' );
  • lib/tabs/indexing-tab.php line 291
    apply_filters( 'relevanssi_premium_indexing_config', $premium_indexing_config );
  • lib/tabs/indexing-tab.php line 330
    apply_filters( 'relevanssi_premium_stopwords_config', $stopwords_config );
  • lib/search.php line 568
    apply_filters( 'relevanssi_truncate_search_queries', 0 );
  • lib/tabs/searching-tab.php line 291
    apply_filters( 'relevanssi_weights_config', $weights_config );
  • lib/compatibility/woocommerce.php line 204
    apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' );
  • lib/utils.php line 453
    apply_filters( 'wpml_active_languages', null );
  • lib/utils.php line 440
    apply_filters( 'wpml_element_language_code', null, $element );

Generated from Relevanssi's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: