PHPackages                             wefabric/wp-excel - 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. wefabric/wp-excel

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

wefabric/wp-excel
=================

Implementation to use Excel export as a bulk action in the WordPress backend.

219PHP

Since Apr 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/wefabric/wp-excel)[ Packagist](https://packagist.org/packages/wefabric/wp-excel)[ RSS](/packages/wefabric-wp-excel/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

WordPress Excel export
======================

[](#wordpress-excel-export)

Implementation to use Excel export as a bulk action in the WordPress backend. To use with the Wefabric themosis implementation. It uses the  (v3.0) package.

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

[](#requirements)

- Wefabric WP Support
- Themosis

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

[](#installation)

Run the following command

```
composer require wefabric/wp-excel
```

Publish the config file

```
php console vendor:publish --tag=wp-excel
```

Usage
-----

[](#usage)

Every post type needs to be registered for export before usage. In the following example we will register the export class for a default WordPress post

1. First you need to create the class which converts the posts data to an Illuminate Collection. To do this run the following command

```
php console make:export PostsExport
```

2. Add the logic to export the WordPress posts to the Illuminate collection for example:

```
use Illuminate\Support\Collection;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Wefabric\WPExcel\Concerns\WpPostsExcellable;

class PostsExport implements FromCollection, WithHeadings, WpPostsExcellable
{

    protected array $postIds = [];

    public function headings(): array
    {
        return [
            'Id',
            'Title',
        ];
    }

    /**
    * @return \Illuminate\Support\Collection
    */
    public function collection(): Collection
    {
        $args = [
            'post_type' => 'post',
            'posts_per_page' => -1,
        ];

        if($this->postIds) {
            $args['post__in'] = $this->postIds;
        }

        $posts = get_posts($args);
        $collection = new Collection();
        foreach ($posts as $post) {
            $collection->push([
                'Id' => $post->ID,
                'Title' => $post->post_title,
            ]);
        }
        return $collection;
    }

    public function setPostIds(array $postIds)
    {
        $this->postIds = $postIds;
    }
}
```

3. Add the class to the wp-excel config file (config/wp-excel.php). Where 'post' is the post type name and the second parameter is the export class

```
return [
  'post_types' => [
    'post' => \App\Exports\PostsExport::class,
  ]
]
```

4. Go to the WordPress backend (wp-admin/edit.php), select a post and run the bulk action.

Export formats
--------------

[](#export-formats)

The default export format is 'XLSX'. To use a different export format change the 'default\_format' in the wp-excel config file (config/wp-excel.php) to the correct format. The allowed export formats are located here:

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

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/8834dc84f62a7c139ded639124a4f9a3bfd03e8ccac75db9f83107ed38ebca39?d=identicon)[slicklabs](/maintainers/slicklabs)

---

Top Contributors

[![leoflapper](https://avatars.githubusercontent.com/u/2369607?v=4)](https://github.com/leoflapper "leoflapper (7 commits)")

### Embed Badge

![Health badge](/badges/wefabric-wp-excel/health.svg)

```
[![Health](https://phpackages.com/badges/wefabric-wp-excel/health.svg)](https://phpackages.com/packages/wefabric-wp-excel)
```

###  Alternatives

[faonni/module-indexer-url-rewrite

Extension rebuild UrlRewrite index.

4072.4k](/packages/faonni-module-indexer-url-rewrite)

PHPackages © 2026

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