This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

CloudwaysCDN — a powerful solution that offers superior performance and satisfied global audience for your business. Read More

How To Add Custom Action Tools in WooCommerce

Updated on  8th August

3 Min Read
Reading Time: 3 minutes

WooCommerce offers a list of useful default tools (accessed by going to System Status > Tools). However, it is easy to your own custom buttons to this area. This way, you could add custom functionality to your WooCommerce store.

Custom Action Tools in WooCommerce

In this tutorial, I will create a plugin that would add custom action in the WooCommerce tools. In order to add the button, I will start by the hook woocommerce_debug_tools. Next, when  I will create a callback function (called debug_button_action()) that would be triggered when the users click the button. I will place the custom code for the custom action in this function.

Here is the code for the plugin:

Install & Activate the Plugin

The next step is the activation of the plugin. The first step is the creation of a folder in the Plugin folder. Name the folder “Cloudways Tools” and then create a file inside this folder with the name “CW_tools_for_custom_button.php”.

Next go to the WordPress Admin Panel and you will see a new entry with the name Cloudways Tools For Custom Button.

Custom Tool Plugin

Once you have activated the plugin, go to WooCommerce > System  Status

Tool Button

Once you have hit the button, you will see the following:

Triggered Action

Conclusion

In this short tutorial, I discussed how you could easily create and activate a simple plugin that would create a custom order action to the WooCommerce System Status > Tools. You could easily extend this plugin to add your own custom action to WooCommerce store. Let me know if you need help with the code. Just leave a comment and I will get back to you.

Share your opinion in the comment section. COMMENT NOW

Owais Alam

is the WordPress Community Manager at Cloudways - A Managed WooCommerce Hosting Platform and a seasoned PHP developer. He loves to develop all sorts of websites on WordPress and is in love with WooCommerce in particular. You can email him at owais.alam@cloudways.com

Start Growing with Cloudways Today.

Our Clients Love us because we never compromise on these

Get Our Newsletter
Be the first to get the latest updates and tutorials.

THERE’S MORE TO READ.