Hello,
We apologize for the issue you are facing with the URL structure. The reason your post URL is being set to product-categories-5-2
instead of product-categories-5
is likely due to a conflict with an existing post or page that has the same slug. WordPress automatically appends a number to the slug to ensure that each URL is unique.
To resolve this, you can check if there is another post, page, or custom post type with the slug product-categories-5
. If you find one, you can either change its slug or delete it if it’s no longer needed.
If there are no conflicts and the issue persists, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Thank you for raising this concern!
Sources:
WordPress Permalink Structure & Changing Individual URLs » Rank Math
This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.
Hello,
Please note that the slug of your posts/pages is controlled by WordPress and when it finds a duplicate slug, it automatically includes -2
.
If you’re not able to find any post/page on your website with this same URL, we suggest you check your website database and remove the URL from there.
Hope that helps and please don’t hesitate to let us know if you have any other questions.
Thank you.
I discovered the issue: the image file name was the same as the URL slug I assigned to my featured image (product-categories-5.jpg). I’m not sure why, but when I renamed the image and attempted to change the URL, it worked.
Hello,
Yes, this happens when the Redirect Attachments option is enabled on your site, and you have a media or attachment URL with the same slug.
To fix that, you can re-upload the media with a different file name or at least rename the attachment URL to a different slug to avoid getting the -2
or -3
in the last part of the URL as you mentioned.
Looking forward to helping you.