WooCommerce Tutorials

How To Remove The Duplicate Product Button In WooCommerce

WooCommerce is an enormously diverse platform which has the facility to cater for online retailers of all shapes and sizes. Regardless of the size of your store, as soon as you have completed the installation you will be faced with the same task, getting your products listed for your customers to browse and hopefully then purchase.

The unfortunate reality is that listing a lot of products can quickly become a dull and repetitive task. Thankfully, WooCommerce offers a range of handy features to help make your life easier and speed up the process but be warned, if used without caution, those shortcuts can quickly cause unknown damage.


Product Listing Is a Wise Time Investment

By default, a WooCommerce product listing will consist of the following pieces of information:

  • Title
  • Short Description
  • Full Description
  • URL (Permalink)
  • SKU
  • Categories
  • Tags
  • Attributes
  • Shipping Class
  • Tax Class
  • Weight
  • Dimensions
  • Stock
  • Regular Price
  • Sale Price
  • Upsells
  • Cross-Sells

With around seventeen pieces of information to enter each time, you can easily see how the task of adding new products can quickly become tiresome.

Now whilst I fully appreciate that this is a lot of information to handle, you have to keep in mind that, in reality, investing the time into a brilliant product listing will pay off when that listing converts well, particularly with more expensive items.

You have to ask yourself, would you buy a laptop that costs hundreds when the description is only a few sentences long and missing the finer details? Probably not.


The Duplicate Button – Friend Or Foe


WooCommerce Duplicate Product Button

A few years ago I helped a large business set up their WooCommerce store, the company had around 4,000 individual items, and a team of five internal staff members to work through listing them. The director of the company had a vast amount of high street retail experience and understood the value of highly detailed product listings, but understandably at the same time wanted to start converting their stock to revenue as quickly as possible. After a week of training with the listing team, I left them to get on with the challenge.

Whilst the company had a large number of products, many of them were colour variations, an example being a polo shirt which came in one design, but ten different colours. I was asked by a team member whether they could use the ‘duplicate product‘ button within WooCommerce, their intentions being to create a high-quality initial listing, and then duplicate it for the colour variations to then go in an only have to modify the required details as opposed to having to start from a blank canvas. Given the fact that time was limited and product descriptions were never really going to change on a colour variation, I agreed that the tool could be used on the strict premise that the duplications were altered and checked each time.

To begin with, the tool was used without issue and all variations were checked entirely before publication, but as time went on, and the pressure to have products listed increased, mistakes began to show. Whilst spot-checking listings I started to notice a whole range of issues, products with the same titles, a red shirt listed with the blue colour attribute, etc. The duplicate button was doing exactly what it was designed to do but was ultimately helping the team to make errors with duplicate or incorrect information.


How To Hide To Duplicate Product Option

After some internal discussions, the decision was made to remove the button in an attempt to stop the issues that had arisen. Thanks to the mass amount of ways in which you can hook into WooCommerce, only a small block of code was required to achieve this.


function wpcodetips_remove_duplicate($actions,$post){
    if($post->post_type != 'product'){
        return $actions;
    }
    unset($actions['duplicate']);
    return $actions;
}
add_filter('post_row_actions','wpcodetips_remove_duplicate',15,2);
add_filter('page_row_actions','wpcodetips_remove_duplicate',15,2);

You will notice that this function is capable of removing the duplicate button for all post types, but in this case, we are only interested in products, hence the check on the first few lines, if the post type is not a product then it returns immediately and does not continue.


WooCommerce Duplicate Product Button Removed

Conclusion

I was originally going to title this article ‘Why you should disable the duplicate product button in WooCommerce’ due to the circumstances in which I needed to implement it, but the reality is the real reason I needed to hide the button is to stop issues caused by people not taking the necessary checks.

As with all tutorials on this website, I wanted to explain the real-world situations where this adjustment may be necessary. With most new clients in a similar situation, I now tend to disable the duplicate button by default and then enable it following a full explanation as to what could go wrong if not used in the correct way.

I hope this has helped you see the potential dangers involved with duplicating your website content, and how you can implement a simple fix to stop it. If you have added this feature to your website or have any other questions, then please leave them in the comments below!

Buy Me a Coffee?Buy Me a Coffee?
Gary

Hi, my name is Gary, I hope to share some of my real-world programming experiences and code solutions to help you develop your Wordpress and WooCommerce skills.

Leave a Reply

Your email address will not be published. Required fields are marked *