How to Create a Custom System Status Tool
Quite recently I was guess what – working on my Simple Inventory Sync plugin and I was needed some kind of functionality that allows to push the actual product stock quantity to all substores via WooCommerce REST API (and that’s why it should be doing it in the background).
And I think that to create a tool in WooCommerce > Status > Tools is the most seemless way to implement that functionality.
For me it is still doesn’t make any sense why plugin developers overload WordPress admin menu with tons of settings when you can use build-in UI for that. Well, this is another story.
Here is a status tool we are going to create in this tutorial:

Well, guys, creating your own custom system status tool in WooCommerce is as easy as to use woocommerce_debug_tools
filter hook (and code snippet below).
add_filter( 'woocommerce_debug_tools', 'rudr_status_tool' );
function rudr_status_tool( $tools ) {
$new_tool = array(
'rudrtool' => array(
'name' => 'Tool by Misha',
'button' => 'Start doing something',
'desc' => 'This tool allows to do something',
'callback' => 'rudr_do_something',
'disabled' => false,
),
);
$tools = array_slice( $tools, 0, 2, true ) + $new_tool + array_slice( $tools, 2, NULL, true );
return $tools;
}
// callback
function rudr_do_something() {
return 'Something has been done!';
}
Let’s desonstruct the above code just a little bit:
- As you can see I used
array_slice()
PHP function in order to display the tool in the first positions (after “Expired Transients” in our case. By default custom tool appear at the very bottom, just after “Regenerate the product attributes lookup table”. In our case – just replace number2
with a position number where your would like your tool to be displayed. disabled
parameter on line11
when set totrue
allows your tool to be displayed in the least but with unclickable (disabled) button.rudr_do_something()
is a function that does all the stuff. If you are inside a class, you can pass it as an arrayarray( $this, 'do_something' )
.- There is also another hook woocommerce_system_status_tool_executed which runs when the tool did its stuff.
- And the last but not least, if you don’t know where to insert the code, read this.

Misha Rudrastyh
Hey guys and welcome to my website. For more than 10 years I've been doing my best to share with you some superb WordPress guides and tips for free.
Need some developer help? Contact me
Hey Misha,
Good article! Currently working on something like this as-well. Did you also consider synchronising stock from the row actions? Might be a nice-to-have.
Keep it up🔥
Hey Klaas,
I didn’t, yet. Thank you! 🔥