-
Im on kind of a see-saw right now where I can only kinda get what I am looking for.
I like how RankMath allows me to strip the category and base from the product pages. Ideally what I would like to add to this is simply the post_id in case vendors carry the same product or a single vendor has an identical named product for whatever reason (maybe quantity in the box is different).
The only way I have been able to do close to what I am looking for is by going into Settings > Permalinks and add a custom base with:
/product/%product_cat%/%post_id%/ (note that the first directory “product” can be changed to any text and the URLs will work)
The problem is that if I specify this in the permalinks section the /product/ base is no longer stripped…on mouseover. However, once you click on the URL it is redirected to the stripped version..meaning all my product pages will have redirects on them?
In addition, I would prefer that there isn’t the need to add the product categories to the URLs but every combination I tried of attempts to try removing them AND still maintain the post_id in the URL failed = no post_id in URL. Removing the first directory “/product/” also results in no post_id in the URL.
An ideal world I would love to have the product pages:
/post_id/product_name
/product_id/post_idI can see optionally including the categories which oddly enough is where I am (minus the redirects explained above).
Any thoughts on solving this?
Thanks in advance!
The ticket ‘Adding Post ID to Product Pages’ is closed to new replies.