PHPackages                             dudo1985/wpdocgen - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. dudo1985/wpdocgen

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

dudo1985/wpdocgen
=================

Documentation Generator for WordPress.

v2.0.3.1(2y ago)2327.6k↓43.3%3MITPHPPHP &gt;=8.0

Since Apr 4Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Dudo1985/WPDocGen)[ Packagist](https://packagist.org/packages/dudo1985/wpdocgen)[ Fund](https://www.paypal.com/donate/?hosted_button_id=SVTAVUF62QZ4W)[ Fund](https://ko-fi.com/dudo1985)[ RSS](/packages/dudo1985-wpdocgen/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)DependenciesVersions (9)Used By (0)

WP Doc Generator
================

[](#wp-doc-generator)

WordPress Doc Generator is a tool to automatically extract data about the **actions**, **filters** and **shortcodes** of your WordPress theme or plugin.

Table of contents
-----------------

[](#table-of-contents)

- [Getting Started](#getting-started)
- [Command Line Usage](#command-line-usage)
- [Notes](#notes)
- [Alternatives](#alternatives)
- [Links](#links)

Getting Started
---------------

[](#getting-started)

### Installation

[](#installation)

Install it with composer

```
composer require dudo1985/wpdocgen --dev

```

Command Line Usage
------------------

[](#command-line-usage)

First parameter is the input directory, second is the output file, e.g.

#### `vendor/bin/wp-doc-gen . hooks.md`

[](#vendorbinwp-doc-gen--hooksmd)

This will parse all the files in the current directory (.) and write a file called hooks.md

### Optional params

[](#optional-params)

#### `--shortcodes` or `-s`

[](#--shortcodes-or--s)

By default, WPDocGen search for hooks `apply_filters` and `do_actions`. However, if you use the `--shortcodes` or `-s` will search for `add_shortcode` function instead.

#### `vendor/bin/wp-doc-gen . shortcodes.md -s`

[](#vendorbinwp-doc-gen--shortcodesmd--s)

---

#### `--exclude` or `-e`

[](#--exclude-or--e)

Exclude the specified folders, e.g.

#### `vendor/bin/wp-doc-gen . hooks.md --exclude vendor node_modules`

[](#vendorbinwp-doc-gen--hooksmd---exclude-vendor-node_modules)

Another example, if you're launching the script from another dir:

#### `vendor bin/wp-doc-gen.php ../my-plugin/ docs/hooks.md --exclude vendor node_modules  --prefix yasr`

[](#vendor-binwp-doc-genphp-my-plugin-docshooksmd---exclude-vendor-node_modules----prefix-yasr)

There is no need to include the full paths of the excluded dirs, it is automatically ../my-plugin/vendor and ../my-plugin/node\_modules

---

#### `--prefix` or `-p`

[](#--prefix-or--p)

Only parse hooks or shortcodes starting with the specified prefixes.

#### `vendor/bin/wp-doc-gen . hooks.md --exclude vendor node_modules --prefix prefix_1 prefix_2`

[](#vendorbinwp-doc-gen--hooksmd---exclude-vendor-node_modules---prefix-prefix_1-prefix_2)

---

#### `--verbose` or `-v`

[](#--verbose-or--v)

More detailed error messages.

---

#### `--version` or `-V`

[](#--version-or--v)

Print the version number

Real life Examples
------------------

[](#real-life-examples)

### Generated markdown files

[](#generated-markdown-files)

- [https://github.com/Dudo1985/Yet-Another-Stars-Rating/blob/master/docs/yasr\_hooks.md](https://github.com/Dudo1985/Yet-Another-Stars-Rating/blob/master/docs/yasr_hooks.md)
- [https://github.com/Dudo1985/Yet-Another-Stars-Rating/blob/master/docs/yasr\_shortcodes.md](https://github.com/Dudo1985/Yet-Another-Stars-Rating/blob/master/docs/yasr_shortcodes.md)

### Composer script

[](#composer-script)

- [How I use it into composer](https://github.com/Dudo1985/Yet-Another-Stars-Rating/blob/182b01703f62e3303fe214252ad34cf4c2813005/composer.json#L18)

Notes
-----

[](#notes)

To make the parser work fine, the comment must be a valid phpDocBlock, e.g.

> ```
> /**
> * Use this action to add tabs inside shortcode creator for tinymce
> */
> do_action('yasr_add_tabs_on_tinypopupform');
>
> ```

will generate this code

> ### `do_action('yasr_add_tabs_on_tinypopupform')`
>
> [](#do_actionyasr_add_tabs_on_tinypopupform)
>
> Source: [../yet-another-stars-rating/admin/editor/YasrEditorHooks.php, line 219](../yet-another-stars-rating/admin/editor//YasrEditorHooks.php:219)
>
> *Use this action to add tabs inside shortcode creator for tinymce*

or, another example with tags

> ```
> /**
> * Use this action to add content inside shortcode creator
> *
> * @param int $n_multi_set
> * @param string $multi_set the multiset name
> */
> do_action('yasr_add_content_on_tinypopupform', $n_multi_set, $multi_set);
>
> ```

will generate this code with table

> ### `do_action('yasr_add_content_on_tinypopupform')`
>
> [](#do_actionyasr_add_content_on_tinypopupform)
>
> Source: [../yet-another-stars-rating/admin/editor/YasrEditorHooks.php, line 235](../yet-another-stars-rating/admin/editor/YasrEditorHooks.php:235)
>
> *Use this action to add content inside shortcode creator*
>
> ```
>
> | Argument     | Type   | Description       |
> |--------------|--------|-------------------|
> | $n_multi_set | int    |                   |
> | $multi_set   | string | the multiset name |
>
> ```

But, if you use the type *after* the argument, e.g.

> ```
> /**
> * @param $n_multi_set int
> */
>
> ```

this will insert the type (*int* and *string* in this example) inside the "Description" column:

> ```
> | Argument     | Type | Description              |
> |--------------|------|--------------------------|
> | $n_multi_set |      | int                      |
>
> ```

Alternatives
------------

[](#alternatives)

Here is a list of alternatives that I found. However, none of these satisfied my needs

- [WP Documentor](https://github.com/pronamic/wp-documentor/) by [Pronamic](https://github.com/pronamic)| This is the project that I used for a while, but I needed something to best fit my needs. The following list comes from their readme
- [WP Parser](https://github.com/WordPress/phpdoc-parser) by [WordPress](https://github.com/WordPress)
- [Hookster](https://github.com/themeblvd/hookster) by [Theme Blvd](https://github.com/themeblvd)
- [WordPress HookDoc](https://github.com/matzeeable/wp-hookdoc) by [Matthias Günter](https://github.com/matzeeable)
- [GitHub Actions for WordPress](https://github.com/10up/actions-wordpress/blob/stable/hookdocs-workflow.md) by [10up](https://github.com/10up)
- [Yoast Parser](https://github.com/Yoast/code-documentation-extractor) by [Yoast](https://github.com/Yoast)
- [WooCommerce Code Reference Generator](https://github.com/woocommerce/code-reference) by [WooCommerce](https://github.com/woocommerce)
- [WordPress Hooks Reference](https://github.com/johnbillion/wp-hooks) by [John Blackbourn](https://github.com/johnbillion) / [Human Made](https://github.com/humanmade)
- [wp-hooks-generator](https://github.com/johnbillion/wp-hooks-generator) by [John Blackbourn](https://github.com/johnbillion) / [Human Made](https://github.com/humanmade)

Links
-----

[](#links)

-
-
- [https://developer.wordpress.org/reference/functions/do\_action/](https://developer.wordpress.org/reference/functions/do_action/)
- [https://developer.wordpress.org/reference/functions/add\_action/](https://developer.wordpress.org/reference/functions/add_action/)
-
- [https://developer.wordpress.org/reference/functions/apply\_filters/](https://developer.wordpress.org/reference/functions/apply_filters/)
- [https://developer.wordpress.org/reference/functions/add\_filter/](https://developer.wordpress.org/reference/functions/add_filter/)
-
- [https://developer.wordpress.org/reference/functions/add\_shortcode/](https://developer.wordpress.org/reference/functions/add_shortcode/)
-
-

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~67 days

Recently: every ~99 days

Total

7

Last Release

739d ago

Major Versions

v1.0.1 → v2.0.02023-04-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/58d1ffbb202ef60e44b82a768cbfaba4b90dc853a3fc0d32fa68941fb20f809c?d=identicon)[Dudo1985](/maintainers/Dudo1985)

---

Top Contributors

[![Dudo1985](https://avatars.githubusercontent.com/u/5710734?v=4)](https://github.com/Dudo1985 "Dudo1985 (87 commits)")

---

Tags

phpdocwordpressdocumentationmarkdownhooks

### Embed Badge

![Health badge](/badges/dudo1985-wpdocgen/health.svg)

```
[![Health](https://phpackages.com/badges/dudo1985-wpdocgen/health.svg)](https://phpackages.com/packages/dudo1985-wpdocgen)
```

###  Alternatives

[daux/daux.io

Documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly

825191.0k1](/packages/daux-dauxio)[evert/phpdoc-md

PHP documentation generator, with markdown output

169170.9k92](/packages/evert-phpdoc-md)[cvuorinen/phpdoc-markdown-public

phpDocumentor template that generates Markdown documentation of the public API

3613.8k16](/packages/cvuorinen-phpdoc-markdown-public)[wpreadme2markdown/wpreadme2markdown

Convert WordPress Plugin readme.txt to Markdown

9564.6k4](/packages/wpreadme2markdown-wpreadme2markdown)[bookdown/bookdown

Provides DocBook-like rendering of Markdown files.

8257.6k16](/packages/bookdown-bookdown)[clean/phpdoc-md

Parse PHP classes and writes documentation to markdown files

46128.0k40](/packages/clean-phpdoc-md)

PHPackages © 2026

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