Better Find and Replace 2.0.1 has 25 actions and 91 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.
// Run your own code when Better Find and Replace fires an action
add_action( 'bfr_code_insert_saved', function( $slot, $stored ) {
// Your code runs here.
}, 10, 2 );
// Change a value Better Find and Replace is about to use
add_filter( 'bfr_redirect_validate', function( $errors, $arg2 ) {
// Change $errors here.
return $errors;
}, 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
-
bfr_redirect_validate
filter/** * Filter validation errors for a redirect. */ apply_filters( 'bfr_redirect_validate', $errors, array( 'source' => $source_key, 'source_hash' => $source_hash, 'destination' => $destination, 'type' => $type, 'match_type' => 'exact', ) ); -
bfrp_find_replace_variants
filter/** * This is not our filter - it belongs to DbReplacer, and we are asking it the * same question the engine will ask so the preview cannot disagree with the * apply. */ apply_filters( 'bfrp_find_replace_variants', $variants, (string) $find, (string) $replace, array( 'encoded_urls' => (bool) $encoded, 'url_formats' => false, 'url_mode' => false, 'force_encoded' => false, ) ); -
bfr_404_daily_budget
filter/** * Filter the daily distinct-path budget for the 404 log. */ apply_filters( 'bfr_404_daily_budget', $budget ); -
bfr_404_retention_days
filter/** * Filter how many days 404 rows are kept. */ apply_filters( 'bfr_404_retention_days', $days ); -
bfr_404_row_actions
filter/** * Filter the row actions on a 404. */ apply_filters( 'bfr_404_row_actions', $actions, $item ); -
bfr_404_should_log
filter/** * Filter whether one 404 is recorded. */ apply_filters( 'bfr_404_should_log', $should_log, $path, array( 'request' => $request, 'referrer' => self::referrer(), 'user_agent' => $user_agent, ) ); -
bfr_clone_denied_meta
filter/** * Filter the meta keys a clone must not carry. */ apply_filters( 'bfr_clone_denied_meta', $denied ); -
/** * Filter denials that depend on which keys the post actually has. */ apply_filters( 'bfr_clone_denied_meta_for_post', $denied, array_keys( $meta ) ); -
bfr_clone_post_data
filter/** * Filter the post data a clone is created from. */ apply_filters( 'bfr_clone_post_data', $row, $post ); -
bfr_clone_post_type
filter/** * Filter whether a post type may be duplicated. */ apply_filters( 'bfr_clone_post_type', true, $type ); -
bfr_clone_title
filter/** * Filter the title a clone is given. */ apply_filters( 'bfr_clone_title', $cloned, $post ); -
bfr_code_insert_can_edit
filter/** * Filter whether the current user may save code snippets. */ apply_filters( 'bfr_code_insert_can_edit', $can ); -
bfr_code_insert_findings
filter/** * Filter the findings for one snippet. */ apply_filters( 'bfr_code_insert_findings', $out, $content ); -
bfr_code_insert_output
filter/** * Filter one snippet immediately before it is printed. */ apply_filters( 'bfr_code_insert_output', $content, $slot ); -
bfr_code_insert_priority
filter/** * Filter the hook priority one slot prints at. */ apply_filters( 'bfr_code_insert_priority', (int) $fallback, (string) $slot ); -
bfr_code_insert_saved
action/** * Fires after a code snippet is stored. */ do_action( 'bfr_code_insert_saved', $slot, $stored[ $slot ] ); -
bfr_code_insert_should_run
filter/** * Filter whether code snippets print on this request. */ apply_filters( 'bfr_code_insert_should_run', true ); -
bfr_dashboard_cards
filter/** * Filter the dashboard cards. */ apply_filters( 'bfr_dashboard_cards', $cards, $summary ); -
bfr_dashboard_screens
filter/** * Filter the Site Health tabs. */ apply_filters( 'bfr_dashboard_screens', $tabs ); -
bfr_issue_type_for_group
filter/** * Filter the issue type a grouped URL is recorded under. */ apply_filters( 'bfr_issue_type_for_group', $type, $group ); -
bfr_link_batch_size
filter/** * Filter how many posts one link-scan batch reads. */ apply_filters( 'bfr_link_batch_size', $size ); -
/** * Filter how many failed checks are needed before a link is broken. */ apply_filters( 'bfr_link_failures_before_broken', $needed ); -
bfr_link_resolution
filter/** * Filter the resolution of one URL. */ apply_filters( 'bfr_link_resolution', $result, $url, $path, $site_host, array( 'type' => $type ) ); -
bfr_link_statuses
filter/** * Filter which post statuses the link scanner reads. */ apply_filters( 'bfr_link_statuses', $statuses ); -
bfr_link_targets
filter/** * Filter which post types the link scanner reads. */ apply_filters( 'bfr_link_targets', array_values( $types ) ); -
bfr_maintenance_can
filter/** * Filter one entitlement answer. */ apply_filters( 'bfr_maintenance_can', $default, $key, $known ); -
bfr_maintenance_flush_caches
filter/** * Fires after a Replace + Redirect, for caches this class cannot detect. */ apply_filters( 'bfr_maintenance_flush_caches', $purged ); -
bfr_maintenance_installed
action/** * Fires after the maintenance tables are created or upgraded. */ do_action( 'bfr_maintenance_installed', self::DB_VERSION ); -
/** * Filter the row actions on an issue. */ apply_filters( 'bfr_maintenance_issue_actions', $actions, $item ); -
/** * Fires when an issue is recorded for the first time. */ do_action( 'bfr_maintenance_issue_created', $issue_key, $row ); -
/** * Fires when an issue is ignored. */ do_action( 'bfr_maintenance_issue_ignored', $id ); -
/** * Fires when an issue is resolved. */ do_action( 'bfr_maintenance_issue_resolved', $id ); -
bfr_maintenance_job_handlers
filter/** * Register queue job handlers. */ apply_filters( 'bfr_maintenance_job_handlers', array() ); -
bfr_maintenance_list_actions
filter/** * Filter the controls shown above the issues list. */ apply_filters( 'bfr_maintenance_list_actions', '', $this->type ); -
bfr_maintenance_queue_batch
filter/** * Filter how many jobs one tick claims. */ apply_filters( 'bfr_maintenance_queue_batch', $size ); -
bfr_maintenance_queue_driver
filter/** * Filter the queue driver. */ apply_filters( 'bfr_maintenance_queue_driver', $driver ); -
/** * Filter the gap between queue ticks, in seconds. */ apply_filters( 'bfr_maintenance_queue_next_delay', $delay ); -
/** * Filter the per-tick time budget in seconds. */ apply_filters( 'bfr_maintenance_queue_time_budget', $budget ); -
/** * Fires when a scan run completes. */ do_action( 'bfr_maintenance_scan_completed', $id ); -
bfr_maintenance_scan_failed
action/** * Fires when a scan run fails. */ do_action( 'bfr_maintenance_scan_failed', $id ); -
bfr_maintenance_scan_started
action/** * Fires when a scan run opens. */ do_action( 'bfr_maintenance_scan_started', $id, (string) $scan_type ); -
bfr_maintenance_screens
filter/** * Filter the Content Health tabs. */ apply_filters( 'bfr_maintenance_screens', $tabs ); -
bfr_media_extensions
filter/** * Filter the extensions accepted as media. */ apply_filters( 'bfr_media_extensions', array( 'jpg', 'jpeg', 'jpe', 'png', 'gif', 'webp', 'avif', 'svg', 'bmp', 'ico', 'tif', 'tiff', 'heic', 'mp4', 'm4v', 'mov', 'webm', 'ogv', 'avi', 'mpg', 'mpeg', 'wmv', 'flv', 'mp3', 'm4a', 'ogg', 'oga', 'wav', 'flac', 'aac', 'wma', 'pdf', ) ); -
bfr_media_occurrence_types
filter/** * Filter which occurrence types count as media. */ apply_filters( 'bfr_media_occurrence_types', $types ); -
bfr_post_cloned
action/** * Fires after a post has been cloned. */ do_action( 'bfr_post_cloned', $new_id, (int) $post->ID, $meta['skipped'] ); -
bfr_redirect_before_execute
filter/** * Fires before a redirect is sent. Return false to cancel it. */ apply_filters( 'bfr_redirect_before_execute', true, $match, $request ); -
bfr_redirect_count_hits
filter/** * Filter whether redirect hits are counted. */ apply_filters( 'bfr_redirect_count_hits', true ); -
bfr_redirect_deleted
action/** * Fires after a redirect rule has been deleted. */ do_action( 'bfr_redirect_deleted', (int) $id ); -
bfr_redirect_executed
action/** * Fires after a redirect has been sent to the visitor. */ do_action( 'bfr_redirect_executed', $match, $request ); -
bfr_redirect_match
filter/** * Filter in a non-exact match. */ apply_filters( 'bfr_redirect_match', null, $request ); -
bfr_redirect_match_types
filter/** * Filter the available match types. */ apply_filters( 'bfr_redirect_match_types', $types ); -
bfr_redirect_row_actions
filter/** * Filter the row actions on a redirect. */ apply_filters( 'bfr_redirect_row_actions', $actions, $item ); -
bfr_redirect_screens
filter/** * Filter the Redirects tabs. */ apply_filters( 'bfr_redirect_screens', $tabs ); -
bfr_redirect_types
filter/** * Filter the available redirect types. */ apply_filters( 'bfr_redirect_types', self::free_types() ); -
bfr_redirects_changed
action/** * Fires after any change to the redirect set. */ do_action( 'bfr_redirects_changed', $count ); -
/** * Fires when a Replace + Redirect finishes. */ do_action( 'bfr_replace_redirect_after_apply', $result ); -
bfar_save_item_history
actiondo_action( 'bfar_save_item_history', \json_encode( array( 'tbl' => $tbl, 'rid' => $row_id, 'pCol' => $primary_col, 'col' => $update_col, 'find' => $primary['find'], 'replace' => $primary['replace'], 'ici' => $isCaseInsensitive, 'old_val' => $original, 'new_val' => $current, ) ) ); -
bfr_dashboard_screen_content
filterapply_filters( 'bfr_dashboard_screen_content', '', $tab ); -
apply_filters( 'bfr_dashboard_screen_subtitle', '', $tab ); -
apply_filters( 'bfr_maintenance_screen_content', $content, $tab ); -
apply_filters( 'bfr_maintenance_screen_header_actions', $actions, $tab ); -
apply_filters( 'bfr_maintenance_screen_status', $status, $tab ); -
bfr_maintenance_screen_well
filterapply_filters( 'bfr_maintenance_screen_well', '', $tab ); -
bfr_maintenance_upgrade_url
filterapply_filters( 'bfr_maintenance_upgrade_url', self::UPGRADE_URL ); -
bfr_redirect_screen_content
filterapply_filters( 'bfr_redirect_screen_content', $content, $tab ); -
bfr_redirect_screen_well
filterapply_filters( 'bfr_redirect_screen_well', '', $tab ); -
bfrp_active_skip_pages
filterapply_filters( 'bfrp_active_skip_pages', FormBuilder::get_value( 'skip_pages', $option, '' ), $option ); -
bfrp_active_skip_posts
filterapply_filters( 'bfrp_active_skip_posts', FormBuilder::get_value( 'skip_posts', $option, '' ), $option ); -
bfrp_after_db_replace
actiondo_action( 'bfrp_after_db_replace', array( 'replaced' => $i, 'where' => $whereToReplace, 'builders' => $this->selected_builders, 'post_ids' => array_keys( $this->touched_post_ids ), 'settings' => $this->settings, ) ); -
apply_filters( 'bfrp_all_masking_rules_tbl_rows', array( 'cb' => '<input type="checkbox" />', 'find' => __( 'Find', 'real-time-auto-find-and-replace' ), 'replace' => __( 'Replace by', 'real-time-auto-find-and-replace' ), 'type' => __( 'Rule Type', 'real-time-auto-find-and-replace' ), 'where_to_replace' => __( 'Where to replace', 'real-time-auto-find-and-replace' ), ) ); -
bfrp_before_insert_new_rule
filterapply_filters( 'bfrp_before_insert_new_rule', $user_query ); -
bfrp_builder_registry
filterapply_filters( 'bfrp_builder_registry', $map ); -
bfrp_column_country_rules
actiondo_action( 'bfrp_column_country_rules', $item ); -
bfrp_column_find
actiondo_action( 'bfrp_column_find', $item ); -
bfrp_column_lang_rules
actiondo_action( 'bfrp_column_lang_rules', $item ); -
bfrp_column_skip_pages
actiondo_action( 'bfrp_column_skip_pages', $item ); -
bfrp_column_skip_posts
actiondo_action( 'bfrp_column_skip_posts', $item ); -
bfrp_column_type_text
filterapply_filters( 'bfrp_column_type_text', $item ); -
bfrp_custom_tables
filterapply_filters( 'bfrp_custom_tables', $this->settings, $tables ); -
bfrp_db_columns
filterapply_filters( 'bfrp_db_columns', array( 'all' => __( 'Select All', 'real-time-auto-find-and-replace' ), 'unselect_all' => __( 'Unselect All', 'real-time-auto-find-and-replace' ), 'post_title' => \ucwords( sprintf( __( '%s Title', 'real-time-auto-find-and-replace' ), $type ) ), 'post_content' => \ucwords( sprintf( __( '%s Content', 'real-time-auto-find-and-replace' ), $type ) ), 'post_excerpt' => \ucwords( sprintf( __( '%s Exce... ); -
bfrp_dryrun_final_report
filterapply_filters( 'bfrp_dryrun_final_report', $dryRunReport ); -
bfrp_filterSnAnrFields
filterapply_filters( 'bfrp_filterSnAnrFields', $isShowScFields, $option, $ruleType ); -
bfrp_flush_object_cache
filterapply_filters( 'bfrp_flush_object_cache', true ); -
bfrp_format_find_whole_word
filterapply_filters( 'bfrp_format_find_whole_word', $this->settings, $isCaseInsensitive, $find ); -
bfrp_get_rules_sql
filterapply_filters( 'bfrp_get_rules_sql', array( 'where_to_replace' => $where_to_replace, 'where_id' => $where_id, 'ruleType' => $ruleType, ) ); -
apply_filters( 'bfrp_masking_location_options', array( 'all' => __( 'All over the website', 'real-time-auto-find-and-replace' ), 'specificPagePost_disabled' => __( 'On specific page or post - pro version only', 'real-time-auto-find-and-replace' ), ) ); -
bfrp_masking_rule_options
filterapply_filters( 'bfrp_masking_rule_options', array( 'hasGroup' => array( __( 'Realtime Masking (no effect in Database)', 'real-time-auto-find-and-replace' ) => array( 'plain' => __( 'Plain Text', 'real-time-auto-find-and-replace' ), 'regex' => __( 'Regular Expression - Managed', 'real-time-auto-find-and-replace' ), 'regexCustom' => __( 'Regular Expression - Custom', 'real-time-auto-find-and-replace' ), 'ajaxContent' => __( 'jQuery / Ajax ... ); -
bfrp_masking_settings_fields
filterapply_filters( 'bfrp_masking_settings_fields', $fields, $option ); -
bfrp_media_replacer_fields
filterapply_filters( 'bfrp_media_replacer_fields', $fields, $option ); -
bfrp_render_real_time_rules
filterapply_filters( 'bfrp_render_real_time_rules', $item, $buffer ); -
apply_filters( 'bfrp_replacedb_settings_fields', $fields, $option ); -
bfrp_save_masking_rule
actiondo_action( 'bfrp_save_masking_rule', $isExists, $user_query ); -
bfrp_select_tables
filterapply_filters( 'bfrp_select_tables', array() ); -
bfrp_should_load_form_assets
filterapply_filters( 'bfrp_should_load_form_assets', false, $page_id, $rtafr_menu ); -
bfrp_should_load_page_assets
filterapply_filters( 'bfrp_should_load_page_assets', false, $page_id, $rtafr_menu ); -
bfrp_skip_pages
filterapply_filters( 'bfrp_skip_pages', FormBuilder::get_value( 'skip_pages', $option, '' ), $option ); -
bfrp_skip_pages_desc_tip
filterapply_filters( 'bfrp_skip_pages_desc_tip', __( 'Select pages where you don\'t want to apply this rule. e.g: Checkout, Home', 'real-time-auto-find-and-replace' ), $option ); -
bfrp_skip_pages_title
filterapply_filters( 'bfrp_skip_pages_title', sprintf( __( 'Skip Pages %1$s Pro version only %2$s', 'real-time-auto-find-and-replace' ), '<br/><span class="pro-version-only">', '</span>' ), $option ); -
bfrp_skip_posts
filterapply_filters( 'bfrp_skip_posts', FormBuilder::get_value( 'skip_posts', $option, '' ), $option ); -
bfrp_skip_posts_desc_tip
filterapply_filters( 'bfrp_skip_posts_desc_tip', __( 'Select posts where you don\'t want to apply this rule. Rules will be applied on single post pages only. e.g: My post', 'real-time-auto-find-and-replace' ), $option ); -
bfrp_skip_posts_title
filterapply_filters( 'bfrp_skip_posts_title', sprintf( __( 'Skip Posts %1$s Pro version only %2$s', 'real-time-auto-find-and-replace' ), '<br/><span class="pro-version-only">', '</span>' ), $option ); -
apply_filters( 'bfrp_skip_realtime_content_filter', false ); -
bfrp_url_replacer
filterapply_filters( 'bfrp_url_replacer', $this->settings, $inWhichUrl ); -
bfrp_url_types
filterapply_filters( 'bfrp_url_types', array( 'all' => __( 'Select All', 'real-time-auto-find-and-replace' ), 'unselect_all' => __( 'Unselect All', 'real-time-auto-find-and-replace' ), 'post' => __( 'Post URLs', 'real-time-auto-find-and-replace' ), 'page' => __( 'Page URLs', 'real-time-auto-find-and-replace' ), 'attachment' => __( 'Media URLs (images, attachments etc..)', 'real-time-auto-find-and-replace' ), ) ); -
bfrp_where_to_replace
filterapply_filters( 'bfrp_where_to_replace', $item ); -
apply_filters( 'bfrp_where_to_replace_options', array( 'tables' => __( 'Database Tables', 'real-time-auto-find-and-replace' ), 'urls' => __( 'All URLs', 'real-time-auto-find-and-replace' ), 'page' => __( 'In All Pages', 'real-time-auto-find-and-replace' ), 'post' => __( 'In All Posts', 'real-time-auto-find-and-replace' ), ) ); -
breeze_clear_all_cache
actiondo_action( 'breeze_clear_all_cache' ); -
litespeed_purge_all
actiondo_action( 'litespeed_purge_all' ); -
rtafar_ai_oauth_flows
filterapply_filters( 'rtafar_ai_oauth_flows', array( 'openrouter' => '\\RealTimeAutoFindReplace\\admin\\functions\\ai\\OAuth\\OpenRouterFlow', ) ); -
rtafar_ai_providers
filterapply_filters( 'rtafar_ai_providers', self::all() ); -
rtafar_allowed_methods
filterapply_filters( 'rtafar_allowed_methods', $this->allowed_methods() ); -
rtafar_row_meta
filterapply_filters( 'rtafar_row_meta', array( 'docs' => '<a target="_blank" href="' . esc_url( 'https://docs.codesolz.net/better-find-and-replace/' ) . '" aria-label="' . esc_attr__( 'documentation', 'real-time-auto-find-and-replace' ) . '">' . esc_html__( 'Docs', 'real-time-auto-find-and-replace' ) . '</a>', 'videos' => '<a target="_blank" href="' . esc_url( 'https://www.youtube.com/watch?v=nDv6T72sRfc&list=PLxLVEan0phTv5OfCX-FPu6n... );
Generated from Better Find and Replace'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: