Change permalink

#552672
  • Resolved Melissa Roos
    Rank Math free

    Hi there,

    I spend the last hour researching your website but I’m afraid I’m not technical enough to deal with this by myself while following your guide. I’m scared I’ll actually break my website.

    I would like to remove the category from my URL structure. Right now, my URLs are structured like this: https://rosymelissa.com/mallorca/best-beaches-in-mallorca/. In this case /mallorca/ is the category. I would like to change all posts URLS to /post-name only. (So: https://rosymelissa.com/best-beaches-in-mallorca/)

    What would be the full redirect to add in RankMath if I would do this?

    I already have one redirect in RankMath from years ago when I removed the date from my URLs. This one is still active. For this one, the source URLs is /([0-9]{4})/([0-9]{2})/(.+) Regex and the destination URL is http://rosymelissa.com/$3

    Would these two redirects conflict with each other? I hope you can help me 🙂 Please let me know if you need any login details or if you could give the description on what I should fill in the redirect then I could probably do it myself, I think.

    Have a good weekend!

    Kind regards,
    Melissa

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention.

    By default, WordPress should automatically redirect your old URL structure to the new one upon changing your permalinks from /%category%/%postname%/ to /%postname%/

    However, if that didn’t happen on your site upon changing the permalinks, you can create a regex redirect per category of your posts.

    Here’s the correct regex redirect you may need to use for mallorca category:

    Source: mallorca/(.*)
    Destination: https://yourwebsite.com/$1

    Also, the redirects should not be in conflict as that is intended for URLs with dates in them.

    Hope that helps.

    Thank you.

    Hi,

    I haven’t changed the settings yet so I don’t know if WordPress will automatically create the redirect in my case. That’d be great. Would my SEO suffer if I did this without redirections via RankMath? And is there perhaps 1 redirect I could use that redirects all URLs instead of per category? I have quite a lot of categories 🙂

    Thanks,
    Melissa

    Hello,

    If you want to create any regex redirection then you’ll have to create this for each of your categories like my colleague shared above.

    In this case, you can change your permalink structure from WordPress Dashboard> Settings > Permalinks and make the structure from /%category%/%postname%/ to /%postname%/, and WordPress will automatically create a redirection for that.

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Change permalink’ is closed to new replies.