How to Remove or Modify Bulk Actions for Custom Post Types

If you purchase through a link on our site, we may earn a commission. Learn more.

It may be handy at times to be able to remove or modify the wording on the Bulk actions dropdown in WordPress. Learn how to do it!

Table of Contents
WP Engine High Performance Hosting
BionicWP Hosting

It may be handy at times to be able to remove or modify the wording on the Bulk actions dropdown in WordPress.

Here’s how to do it.

To remove actions, where bank is the name of the custom post type:

[php]
add_filter( ‘bulk_actions-edit-bank’, ‘my_custom_bulk_actions’ );
function my_custom_bulk_actions( $actions ){
unset( $actions[ ‘edit’ ] );
return $actions;
}
[/php]

We just removed the ‘Edit’ option from the dropdown.

You might think that that filter can also be used for other stuff like adding or modifying the items in the dropdown, however till now it can only be used to remove items.

That does not mean that it is altogether impossible to modify or add items. Check out this tutorial on Foxrunsoftware.net which shows us an example of how we can add items to the bulk actions dropdown. I will report back once I find a solution to modifying the existing items. If you know how to do that, just leave a comment below!

If you are not sure what the screen ID of your page is, check out this excellent tutorial which will explain how to get the screen ID.

Finally, to remove the bulk actions dropdown altogether, you can use this codem where ‘edit-post’ is the screen ID:

[php]
add_filter( ‘bulk_actions-‘ . ‘edit-post’, ‘__return_empty_array’ );
[/php]

If you enjoyed this post, make sure to subscribe to WP Mayor’s RSS feed.

Jean Galea

Jean Galea is an investor, entrepreneur, and blogger. He is the founder of WP Mayor, the plugins WP RSS Aggregator and Spotlight, as well as the Mastermind.fm podcast. His personal blog can be found at jeangalea.com.

Discover more from our archives ↓

Popular articles ↓

2 Responses

  1. ‘bulk_actions-edit-bank’ should be modified to ‘bulk_actions-edit-post’. or ‘bulk_actions-edit-page’
    See

Share Your Thoughts

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

Claim Your Free Website Tip 👇

Leave your name, email and website URL below to receive one actionable improvement tip tailored for your website within the next 24 hours.

"They identified areas for improvement that we had not previously considered." - Elliot

By providing your information, you'll also be subscribing to our weekly newsletter packed with exclusive content and insights. You can unsubscribe at any time with just one click.