In this short article, you can find instructions on how to easily include SKU number in WooCommerce product permalinks.
The functionalities presented in this post are available only in Permalink Manager Pro.
Permalink Manager works perfectly well with WooCommerce post types & taxonomies. For instance, you can use it to remove the permalink bases from products, product categories or tags. In addition, one of the most useful functions is possibility to add SKU numbers to product permalinks.
Custom permalink format example
Original WooCommerce product permalinks:
https://example.com/product/happy-ninja/ https://example.com/product/woo-singles/
New permalink format with SKU:
http://example.com/%product%-%__SKU%
New WordPress permalinks with SKU number added via Permalink Manager:
https://example.com/happy-ninja-83742603880/ https://example.com/woo-singles-18578169213/
Is it possible customize the permalink format and insert SKU anywhere else?
Yes, of course. You can easily customize the products permalink format and add the SKU number any way you like. Below you can see only a basic example.
How to easily add SKU to WooCommerce permalinks?
Go to Permastructures settings page
Add SKU to the product permastructure settings
Now, you need to add “%__sku%” tag inside the permastructure settings for Product post type.
You can insert SKU anyway you like inside the input field. If you would like to use it instead of product slug you will also need to stop Permalink Manager from appending the slug to the end of URL.
To do so, please click on “Show additional settings” to display the additional panel. Then you should enable “Do not automatically append the slug” mode. Afterwards, Permalink Manager will no longer automatically append the product slug to the end of URL.
Add SKU to the existing product permalinks
After you save the new permastructure settings, Permalink Manager will automatically add the SKU number to the product permalinks.
Nevertheless, the old product permalinks need to be regenerated. To apply the new permalink format please go to “Tools -> Regenerate/reset“ section.
To reset the Product’s permalinks please set:
- “Mode” to: “Regenerate custom permalinks“
- “Select content type” to: “Post types“
- “Select post types” to: “Products“
- “Select post statuses” to “Published“
After “Regenerate” button is clicked, a list of updated products’ permalinks should be displayed.