One possibility is to use a plugin like "Permalink Manager Pro" which allows for customizing product URL structures. Here's an example of how to modify the structure to include the SKU and remove the title:
- Install and activate Permalink Manager Pro plugin.
- Go to WordPress dashboard > Permalink Manager > Permastructures tab.
- Find the "Product category" and "Product tag" sections and click "Edit":
- In "Product permalink structure" field enter:
%product_sku%/
. - In "Product category" and "Product tag" settings turn on "Replace regular product permalinks" option.
- Go to "Custom permalinks" tab, click the "Add new" button and fill the form:
- Permalink type: Product
- Title: [leave blank]
- Permalink:
%product_sku%/
Click "Publish" to save changes.
This will modify your product URLs to include the SKU and remove the title from the URL.