Hello,
Thank you for contacting Rank Math today.
You don’t need to use the Redirection tool to do that redirection. You just need to go to the WordPress Dashboard > Rank Math plugin Dashboard > General Settings > Links and enable the Strip Category Base; just as I show you in the following screencast: https://i.rankmath.com/2yJYLg
Looking forward to helping you. Thank you.
​​​​​​
Strip Category base is already enabled on my website & works perfectly and from what I know it works only for category.
In this case, I want to change my post slug and not the category.
Curently my post permalink looks like this https://mywebsite.com/%category%/%postname%/%post_id%/
What I want to change it to
https://mywebsite.com/%postname%/%post_id%/
I can change this myself in permalink settings but the issue is with setting up redirects for all 250+ articles on the site so my articles doesnt hit 404. Thanks
Hello,
If you have enabled in Rank Math plugin Dashboard > General Settings > Redirections, the option called Auto Post Redirect, you can change safely your posts’ permalinks, they will be 301 redirected automatically, just as I show you in the following screencast: https://i.rankmath.com/QIatyu
Thank you.
Yes, my auto-redirect is on but when I change the permalink, all my previous post hits 404 page not found.
Even with the redirect turned out, it still doesn’t redirect to my new permalink.
Maybe you should check this thread (https://support.rankmath.com/ticket/change-in-permalink-settings/) it explains better the issue am experiencing.
I think the solution would be a regex redirection!
Hi,
I am sorry for the confusion.
The auto redirect only works when slugs change. It doesn’t work when you change the permalink structure.
When you change permalink structure, you must add redirects manually. In your case, you will need to do it for each category.
Set it up like this at WordPress Dashboard > Rank Math > Redirections > Add New
Source: /category-name/(.*)$
​Choose regex from the dropdown
​Destination URL: https://domain.com/$1
​Redirection Type: 301
​Status: Activate
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.