How to prevent automatic redirection of 404 errors and “incorrect” URLs? April 5, 2022 by Tarik Billa This worked for me: remove_action('template_redirect', 'redirect_canonical');