URL Guessing is a built-in WordPress feature that attempts to perform automatic redirects when a user lands on an incorrect URL. In other words, WordPress tries to guess the URL and redirects the user to an address similar to the wrong one entered in the browser bar, so instead of getting a 404 page, the user is redirected to the address WordPress thinks they meant.
To disable this feature, add the following code to your theme’s functions.php file:
<?php
function sv_no_redirect_404($redirect_url)
{
if (is_404()) {
return false;
}
return $redirect_url;
}
add_filter('redirect_canonical', 'sv_no_redirect_404');