Nicola Mustone

Happiness Lead @ Automattic



Change the WooCommerce Order/Customer CSV Export capability

By default the plugin WooCommerce Order/Customer CSV Export is available to use for anyone who can manage the shop. This means that all the administrators and shop managers will be able to use it.

But you might need to change this. For example, you might need to exclude the shop managers, and only allow administrators to do this.

Is it possible? Obviously yes!

Open the file functions.php located in wp-content/themes/your-theme-name/ and add this code at the end of the file:

It seems to be complex, but it’s not.
It works also when you don’t have the plugin active, so don’t worry to add/remove it when you update stuffs.

The first part of the code removes the menu WooCommerce > CSV Export for who does not have the capability manage_options. This capability is only available for administrators and super administrators (available in multisites).

The second part removes all the buttons in WooCommerce > Orders, from the actions on the most right of the orders list, to the buttons inside the order edit page and the bulk edit dropdown.

You can tweak this code, to extend the availability of the plugin to more roles, instead of restrict it like i did in this tutorial.

Advertisements

Subscribe to This Blog

Receive new articles from this blog directly in your inbox! No spam guaranteed!

Join 651 other subscribers

Contribute to Improving This Blog

Did you enjoy this article? Was it helpful? Contribute to help me write more articles! The funds collected from this blog are reinvested directly into improving my skills or the blog so that I can provide more and better content!

One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

€5.00
€15.00
€100.00
€5.00
€15.00
€100.00
€5.00
€15.00
€100.00

Or enter a custom amount


Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly
Advertisements

More Posts That You Might Like…


Leave a Reply

Advertisements

Categories

Newsletter

Receive new articles from this blog directly in your inbox!

No spam guaranteed!

Join 651 other subscribers

About The Author

Hi, I’m Nico! Support Lead at Automattic, championing WordPress.com & WooCommerce. Off-duty, I’m at Elemental Beacon, leading epic D&D adventures. Let’s connect, whether it’s about WordPress or a quest!

Advertisements

Don't Miss a Thing!

Receive new articles from this blog directly in your inbox!

No spam guaranteed!

Join 651 other subscribers

Continue Reading

%d bloggers like this: