Prevent automatic redirect after slug change – return 404 instead

#1045319
  • Resolved Dmitry Krivshich
    Rank Math free

    Hello!

    I’m encountering an issue related to redirect behavior when changing the slug of a post or page.

    What I’m trying to achieve:
    When I change the slug of a post/page, I want the old URL (with the previous slug) to return a 404 error, not redirect to the new URL.

    What I did:

    1. Created a page at: https://crosstheworld.ru/sample-page/
    2. Changed the slug to: sample-page-1 (new URL: https://crosstheworld.ru/sample-page-1/)
    3. Enabled Redirection Debug mode in Rank Math.
    4. Set the “Fallback Behavior” in the Redirections module to 404.
    5. Disabled automatic post redirects in Rank Math settings.

    The result:
    Despite these settings, accessing the old URL (/sample-page/) still triggers a 301 redirect to the new URL (/sample-page-1/), while I expect it to return a 404 error instead.

    My question:
    Is it possible to fully disable this automatic redirect behavior using Rank Math, so that WordPress does not redirect the old URL after a slug change, and instead returns a 404 error?
    If so, which exact settings should be used?

    Thank you in advance!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The ticket ‘Prevent automatic redirect after slug change – return 404 instead’ is closed to new replies.