do_redirect_guess_404_permalink filter-hookWP 5.5.0

Filters whether to attempt to guess a redirect URL for a 404 request.

Returning a false value from the filter will disable the URL guessing and return early without performing a redirect.

Usage

add_filter( 'do_redirect_guess_404_permalink', 'wp_kama_do_redirect_guess_404_permalink_filter' );

/**
 * Function for `do_redirect_guess_404_permalink` filter-hook.
 * 
 * @param bool $do_redirect_guess Whether to attempt to guess a redirect URL for a 404 request.
 *
 * @return bool
 */
function wp_kama_do_redirect_guess_404_permalink_filter( $do_redirect_guess ){

	// filter...
	return $do_redirect_guess;
}
$do_redirect_guess(true|false)
Whether to attempt to guess a redirect URL for a 404 request.
Default: true

Changelog

Since 5.5.0 Introduced.

Where the hook is called

redirect_guess_404_permalink()
do_redirect_guess_404_permalink
wp-includes/canonical.php 931
if ( false === apply_filters( 'do_redirect_guess_404_permalink', true ) ) {

Where the hook is used in WordPress

Usage not found.