WordPress filter hook · part of WordPress core
wp_safe_redirect_fallback
A WordPress core filter that 17 plugins also fire themselves, running on 4.3M+ sites between them.
“This filter is documented in wp-includes/pluggable.php”
How to use wp_safe_redirect_fallback
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'wp_safe_redirect_fallback', function( $url, $status ) {
// Change $url here.
return $url;
}, 10, 2 );Argument names come from IP Location Block's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
17 plugins that fire wp_safe_redirect_fallback
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Really Simple Security3+ million installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), 302 )class-admin.php:636 -
All-In-One Security (AIOS)1+ million installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), 302 )classes/wp-security-process-renamed-login-page.php:230 -
Nextend Social Login and Register200,000+ installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), 302 )includes/provider.php:920 -
Theme My Login50,000+ installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), 302 )includes/functions.php:1206 -
SmartCrawl SEO checker, analyzer & optimizer10,000+ installs
apply_filters( 'wp_safe_redirect_fallback', home_url(), $type )includes/modules/advanced/redirects/class-controller.php:747 -
IP Location Block10,000+ installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status )src/Support/Util.php:903 -
IP Geo Block7,000+ installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status )classes/class-ip-geo-block-util.php:506 -
DefendWP Firewall3,000+ installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status )includes/defend-wp-firewall-generic-functions.php:585 -
AJAX Login and Registration modal popup + inline form3,000+ installs
apply_filters( 'wp_safe_redirect_fallback', home_url(), 200 )includes/class-core.php:99 -
WP Hotelier2,000+ installs
apply_filters( 'wp_safe_redirect_fallback', home_url(), 302 )includes/class-htl-form-functions.php:489 -
Coupon Creator1,000+ installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), 301 )plugin-engine/src/Pngx/Install/Setup.php:244 -
Listdom: AI-powered Business Directory with Classifieds Ads Listings1,000+ installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), 302 )app/includes/shortcodes/auth.php:917 -
Digilan Token50+ installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), 302 )includes/digilan-provider.php:595 -
MksDdn Migrate Content20+ installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status )includes/Admin/Services/NotificationService.php:104 -
VistaWP10+ installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status )includes/functions.php:101 -
Suggest 404 linksFewer than 10 installs
apply_filters( 'wp_safe_redirect_fallback', home_url(), 302 )templates/public/suggest404links-widget.php:22 -
Zen Login & AuthenticationFewer than 10 installs
apply_filters( 'wp_safe_redirect_fallback', admin_url(), 302 )includes/helpers.php:81
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.