In this tutorial, we’ll show you how to copy the SKU and the product title to the URL slug in your WooCommerce products..
We know that sometimes you want to customize everything in your WooCommerce store, and it may include your product permalinks.
For example, you may want to add SKUs and Titles to your products URLs, so your permalinks to look like this: www.website.com/ store/ product/ postname-sku.
Or maybe you want them to look like this: www.mywebsite.com/ store/ product/ postname-title.
That, of course, could take you many hours, especially if you have some 5,000 products to edit.
So in this short article, we’ll show you how easy it is to:
- Add SKUs to product URLs
- Add Titles to product URLs
- And add both, SKUs and Titles to your products URLs.
For this, we’ll use the WP Sheet Editor Products Spreadsheet plugin.
Install WP Sheet Editor
*You can skip this step if you have the plugin installed and activated.
You can download the plugin here:
Download WooCommerce Products Spreadsheet Plugin – or – Check the features
This plugin helps you easily manage your WooCommerce products because it displays them all in a beautiful spreadsheet where you can edit freely. It also contains a powerful Bulk Edit tool that allows you to edit thousands of products at once.
Now let’s start editing the permalinks of our products by following the steps below:
1. Open the Bulk Edit tool
This tool will help you apply changes on hundreds or thousands of products at once. You’ll find it on the toolbar, so just click it.
2. Filter your products (Optional)
To filter your products, select the I want to search rows to update option in the Select the rows that you want to update dropdown.
In the search tool, you’ll find these fields:
- Contains keyword – Use this field if you want to look for all products containing a specific keyword.
- Enter Tags – Use this field to search for categories, attributes, tags, shipping classes.
- Search on variations – Use this checkbox to filter variations only.
- Enable advanced filters – This checkbox opens advanced filters to search for your products.
- Run search – This button is to filter your products according to the terms of the search you’ve selected.
After setting the search terms, just hit the Run search button, which will filter your products and take you back to the Bulk Edit tool.
3. Edit your product URLs
Once you’re back in the Bulk Edit tool, you can start editing your product URLs as we show you in the following sections.
a) Add product SKUs to your product URLs
Now you just need to set these values in order to add SKUs to the product URLs:
- Select the rows that you want to update: I want to search rows to update
- What field do you want to edit: URL Slug
- Select type of edit: Copy from other columns
- Copy from this column: $_sku$ (SKU)
- Click on Execute now
After that, your product URLs will be modified.
b) Add product titles to your product URLs
These are the values you need to add your product titles to URLs:
- Select the rows that you want to update: I want to search rows to update
- What field do you want to edit: URL Slug
- Select type of edit: Copy from other columns
- Copy from this column: $post_title$ (Title)
- Click on Execute now
After that, your product URLs will be modified.
c) Add both SKUs and titles to your product URLs
To add both SKUs and titles to your product URLs, you need to set these values:
- Select the rows that you want to update: I want to search rows to update
- What field do you want to edit: URL Slug
- Select type of edit: Set value
- Replace existing value with this value: $post_title$-$_sku$
- Click on Execute now
After that, your product URLs will be modified.
Done!
As you can see, adding SKU or title to your products URLs is really simple with the WP Sheet Editor Products Spreadsheet plugin.
You can download the plugin here:
Download WooCommerce Products Spreadsheet Plugin – or – Check the features