Product SKU is a unique identifier for your product. It is generally used to identify products in inventory and is also useful for tracking purposes. You may want to display the SKU on your product page so that customers can easily identify the product they are interested in.
To display the SKU on your product page, you will need to edit the product template file. The file is located in your theme folder and is called single-product.php.
Once you have located the file, open it in a text editor and look for the following line of code:
get_sku(); ?>
This line of code will output the SKU for the product. If you want to change the way it is displayed, you can modify the code or wrap it in HTML tags. For example, if you want to bold the SKU, you can change the code to this:
However, displaying the SKU on the frontend of your site can also be a security risk. If someone is able to view the source code of your product page, they will be able to see the SKU and could potentially use it to order products without your knowledge.
Therefore, we recommend that you do not display the product SKU on the frontend of your WooCommerce store. If you need to provide the SKU to customers, you can do so in the order confirmation email or in the customer’s account area.
get_sku(); ?>
You can also add other HTML tags to further customize the way it looks. Once you have made your changes, save the file and upload it to your server. The changes will take effect immediately.
If you want to learn more about customizing WooCommerce templates, we have a comprehensive guide that covers everything you need to know.
Conclusion: How Do I Display Product SKU in WooCommerce? To display a product’s SKU on its WooCommerce page, edit the single-product.php template file to include the line of code: get_sku(); ?>.