• Resolved BilalKhan

    (@bilal7k)


    Hello Rank Math,

    I’ve encountered an issue on my WordPress site where spam URLs are redirecting instead of leading to a 404 error. I’m using the Rank Math SEO plugin in Advanced Mode with the 404 Monitor and Redirections settings enabled.

    Example:

    I want these URLs to result in a 404 error instead of automatically redirecting. Is this redirection happening due to Rank Math settings, or could there be another reason?

    How can I configure Rank Math to ensure that URLs with “/1000” go to a 404 error page and do not redirect automatically?

    Thank you for your assistance.

    • This topic was modified 10 months, 2 weeks ago by BilalKhan.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @bilal7k,

    Thank you for contacting support.

    You can check who is handling the redirection by testing the spam URL with the following: https://www.redirect-checker.org/

    You should look at the header called “redirected-by” which should indicate whether it’s WordPress or our plugin doing it.

    If you notice this is being triggered by WordPress it’s likely related to the canonical redirect feature and that can be disabled with the following:
    remove_action( 'template_redirect', 'redirect_canonical' );

    Hope this helps solve your issues.

    Don’t hesitate to get in touch if you have any other questions.

    Thread Starter BilalKhan

    (@bilal7k)

    Hi, it says redirecting by wordpress. Now where do I need to place this code to stop redirection?

    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @bilal7k,

    This code can be added with one of the following options: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Don’t hesitate to get in touch if you have any other questions.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Spam URLs Automatically Redirecting to different URL in my site’ is closed to new replies.