How To Disable Unique SKU's In WooCommerce
WooCommerce is an robust and easily customizable eCommerce solution. WooCommerce is built on top of WordPress. This allows for loads of customization.
The other advantage is that it allows you to make changes to how it functions, without needing to edit it's core files.
On the flip
It is an interesting use case. For example, some users simply add multiple variations of a product as individual products. I do not understand this setup. I believe they enjoy the extra flexibility, of being able to add different variations as individual products.
There is good news. You can disable unique SKU's in WordPress with a single line of PHP. This works because WooCommerce makes really good use of filters. You can add the below code below to your functions.php file or a site specific plugin.
add_filter( 'wc_product_has_unique_sku', '__return_false', PHP_INT_MAX );
Congratulations you have now disabled unique SKU's in WooCommerce. It's an incredibly simple fix for a very interesting problem.
If you have any questions regarding this code or a general question regarding WooCommerce feel free to comment below!
Scott Hartley
Founder & CEO, Sert Media
Founder and CEO of Sert Media, a Nashville-based digital marketing agency. Scott has spent over 15 years helping businesses grow through SEO, web performance optimization, and strategic digital marketing. His deep expertise in WordPress development, site speed, and technical SEO has guided hundreds of brands toward measurable results. When he's not auditing Core Web Vitals or refining campaign strategies, he's writing about the tools, techniques, and trends shaping the modern web.
Related Articles
How to Add Security Headers to WordPress Using Cloudflare Transform Rules
If you've ever run your WordPress site through securityheaders.com and gotten a D or F…
Use This Cloudflare Rule To Reduce Plugin Hack Attempts
Cloudflare Firewall Rules give you a lot of flexibility in further protecting your website. Here…
Set Up Cloudflare's Automatic Platform Optimization Feature
Automatic Platform Optimization (APO) is a new feature from Cloudflare that allows you to cache…