New Feature: Earn 12 Badges

Bild

Collect up to 12 exclusive badges by sharing your plugin collections and engaging with the community.

See all Badges
Debug wp_redirect()
Debug wp_redirect()

by Scott Kingsley Clark

Description

Important: It is not recommended you leave debugging enabled when you’re done, the debug information exposes file paths of files as well as PHP arguments passed into functions from the PHP debug_backtrace() which may contain sensitive information.

This is useful for those times when you have a lot of plugins / theme functions interacting that cause an unknown redirect. This tool helps you figure out what is redirecting and where it’s redirecting at in the code.

This plugin outputs information about each wp_redirect() and wp_safe_redirect() call done on the front and in the admin area of a site.

Usage: Enabling with the setting

You can enable redirect debugging by going to Settings > Debug wp_redirect() on your site or in your network settings (if network activated). You have the option to enable debugging for frontend requests and/or admin dashboard requests. You also have the ability to only show debugging if the person is logged in or is an admin.

If you encounter problems with this plugin blocking redirects you need for logging in or being able to disable the redirect, simply rename the plugin or define this in your wp-config.php file: define( 'DEBUG_WP_REDIRECT', false );

Usage: Enabling through wp-config.php

You can define constants in your wp-config.php file to enable redirect handling for frontend / admin dashboard requests. Constants override any options set in the admin settings page.

  • To enable redirect debugging on the frontend of a site: define( 'DEBUG_WP_REDIRECT', true );
  • To enable redirect debugging in the admin dashboard of a site: define( 'DEBUG_WP_REDIRECT_ADMIN', true );
  • To only show redirect debugging to logged-in admins of a site: define( 'DEBUG_WP_REDIRECT_LOGGED_IN_ADMIN', true );
  • To only show redirect debugging to logged-in users of a site: define( 'DEBUG_WP_REDIRECT_LOGGED_IN', true );
  • To only show redirect debugging to logged-in user ID(s) of a site: define( 'DEBUG_WP_REDIRECT_LOGGED_IN_USER_ID', true );

Usage: Enabling debugging through PHP in your own code

You can enable/disable debugging when you have your own code you want to start/stop debugging after a certain point.

These functions will start/stop debugging the redirects whether it’s on a frontend or admin dashboard request.

  • Enable debugging: debug_wp_redirect_enable()
  • Disable debugging: debug_wp_redirect_disable()

Usage: As an mu-plugin

Take the debug-wp-redirect.php file and add it to your mu-plugin folder in a location like: /wp-content/mu-plugins/debug-wp-redirect.php

You won’t need any other files. The admin settings page will not show up so you will need to use mu-plugin mode specifically with the constants for wp-config.php as documented above.

Contribute to make this plugin better

You can help to make this plugin better through GitHub or sponsor my time.

All texts and images on this product page are protected by copyright and are the property of the author Scott Kingsley Clark. You will be redirected to the retailer to download the plugin. We act solely as a search engine for plugins and are not affiliated with the retailer or Scott Kingsley Clark.

Tags

Free Plugin

5.0
5 Reviews
Last Update
3 years ago
Installations
100
All trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this website are for identification purposes only. The WordPress® trademark is the intellectual property of the WordPress Foundation

Collections

SEO Plugins

  • 6 Plugins
  • 5 Views
Yoast SEO
All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings
WP Fastest Cache

Page Builder

  • 1 Plugin
  • 11 Views
Page Builder: Pagelayer – Drag and Drop website builder

payment methodes per

  • 1 Plugin
  • 5 Views
Payment Gateway Based Fees and Discounts for WooCommerce

SEO

  • 1 Plugin
  • 5 Views
Yoast SEO

Wordpress

  • 13 Plugins
  • 7 Views
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL)
Forminator Forms – Contact Form, Payment Form & Custom Form Builder
Yoast SEO
Site Kit by Google – Analytics, Search Console, AdSense, Speed

slider

  • 1 Plugin
  • 5 Views
Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery

Yeer

  • 1 Plugin
  • 6 Views
Autoptimize

Optimisation Plugins

  • 1 Plugin
  • 12 Views
Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP | Image CDN

Best Speed Plugins

  • 4 Plugins
  • 6 Views
LiteSpeed Cache
WP Fastest Cache
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance
10Web Booster – Website speed optimization, Cache & Page Speed optimizer

Must-Have Plugins

  • 9 Plugins
  • 115 Views
Elementor Website Builder – More than Just a Page Builder
Yoast SEO
All-in-One WP Migration and Backup
Wordfence Security – Firewall, Malware Scan, and Login Security

Best Security Plugins

  • 3 Plugins
  • 5 Views
Jetpack – WP Security, Backup, Speed, & Growth
Wordfence Security – Firewall, Malware Scan, and Login Security
Solid Security – Password, Two Factor Authentication, and Brute Force Protection

Best Member Plugins

  • 5 Plugins
  • 6 Views
Paid Memberships Pro – Content Restriction, User Registration, & Paid Subscriptions
Ultimate Membership Pro - WordPress Membership Plugin
Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress

Best Recruitment Website Plugins

  • 3 Plugins
  • 6 Views
WP Job Openings – Job Listing, Career Page and Recruitment Plugin
Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP | Image CDN
WP Job Manager

Cookie Plugins

  • 3 Plugins
  • 14 Views
CookieYes – Cookie Banner for Cookie Consent (Easy to setup GDPR/CCPA Compliant Cookie Notice)
Autoptimize
Complianz – GDPR/CCPA Cookie Consent

Donation Plugins

  • 2 Plugins
  • 25 Views
Charitable – Donation Plugin for WordPress – Fundraising with Recurring Donations & More
GiveWP – Donation Plugin and Fundraising Platform