PHPackages                             arraypress/wp-register-bulk-actions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. arraypress/wp-register-bulk-actions

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

arraypress/wp-register-bulk-actions
===================================

Lightweight library for registering custom bulk actions in WordPress admin tables.

11PHP

Since Nov 30Pushed 5mo agoCompare

[ Source](https://github.com/arraypress/wp-register-bulk-actions)[ Packagist](https://packagist.org/packages/arraypress/wp-register-bulk-actions)[ RSS](/packages/arraypress-wp-register-bulk-actions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

WordPress Register Bulk Actions
===============================

[](#wordpress-register-bulk-actions)

Simple library for adding custom bulk actions to WordPress admin tables.

Installation
------------

[](#installation)

```
composer require arraypress/wp-register-bulk-actions
```

Usage
-----

[](#usage)

### Posts

[](#posts)

```
register_post_bulk_actions( 'post', [
    'mark_featured' => [
        'label'      => 'Mark as Featured',
        'capability' => 'edit_posts',
        'callback'   => function( $post_ids ) {
            foreach ( $post_ids as $post_id ) {
                update_post_meta( $post_id, '_featured', true );
            }
            return [ 'message' => count($post_ids) . ' posts marked as featured' ];
        }
    ]
] );
```

### Users

[](#users)

```
register_user_bulk_actions( [
    'send_welcome' => [
        'label'      => 'Send Welcome Email',
        'capability' => 'edit_users',
        'callback'   => function( $user_ids ) {
            // Send emails...
            return [ 'message' => 'Emails sent!' ];
        }
    ]
] );
```

### Taxonomies

[](#taxonomies)

```
register_taxonomy_bulk_actions( 'category', [
    'feature_terms' => [
        'label'    => 'Mark as Featured',
        'callback' => function( $term_ids ) {
            foreach ( $term_ids as $term_id ) {
                update_term_meta( $term_id, '_featured', true );
            }
            return [ 'message' => 'Done!' ];
        }
    ]
] );
```

### Comments

[](#comments)

```
register_comment_bulk_actions( [
    'mark_helpful' => [
        'label'    => 'Mark as Helpful',
        'callback' => function( $comment_ids ) {
            foreach ( $comment_ids as $comment_id ) {
                update_comment_meta( $comment_id, '_helpful', true );
            }
            return [ 'message' => 'Marked as helpful' ];
        }
    ]
] );
```

### Media

[](#media)

```
register_media_bulk_actions( [
    'regenerate' => [
        'label'    => 'Regenerate Thumbnails',
        'callback' => function( $attachment_ids ) {
            require_once ABSPATH . 'wp-admin/includes/image.php';

            foreach ( $attachment_ids as $attachment_id ) {
                $file = get_attached_file( $attachment_id );
                $meta = wp_generate_attachment_metadata( $attachment_id, $file );
                wp_update_attachment_metadata( $attachment_id, $meta );
            }

            return [ 'message' => 'Thumbnails regenerated' ];
        }
    ]
] );
```

Options
-------

[](#options)

```
[
    'label'      => 'Action Label',    // Required - shown in dropdown
    'capability' => 'manage_options',  // Optional - default: manage_options
    'callback'   => function( $ids ) { // Required - receives array of IDs
        // Do something with $ids

        // Return success message
        return [ 'message' => 'Done!' ];

        // Or return error
        return [
            'success' => false,
            'message' => 'Error occurred'
        ];
    }
]
```

Multiple Post Types/Taxonomies
------------------------------

[](#multiple-post-typestaxonomies)

```
register_post_bulk_actions( ['post', 'page', 'product'], [
    'my_action' => [ /* ... */ ]
] );

register_taxonomy_bulk_actions( ['category', 'post_tag'], [
    'my_action' => [ /* ... */ ]
] );
```

Features
--------

[](#features)

- ✅ Automatic admin notices
- ✅ Capability checking
- ✅ Success/error handling
- ✅ Works on all admin tables
- ✅ No hooks needed - just call the function

Requirements
------------

[](#requirements)

- PHP 7.4+
- WordPress 5.0+

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance48

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd6eb8aff0903d87eb674d1ba3c5f3653899c0d7661504eb0deb7798ed86b643?d=identicon)[arraypress](/maintainers/arraypress)

---

Top Contributors

[![arraypress](https://avatars.githubusercontent.com/u/22668877?v=4)](https://github.com/arraypress "arraypress (5 commits)")

### Embed Badge

![Health badge](/badges/arraypress-wp-register-bulk-actions/health.svg)

```
[![Health](https://phpackages.com/badges/arraypress-wp-register-bulk-actions/health.svg)](https://phpackages.com/packages/arraypress-wp-register-bulk-actions)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
