Skip to content
PluginStats

wordpress-shortcode-webpack-plugin weekly downloads statistics

By studio-lagier · npm · Webpack plugins

Create Wordpress plugins from React apps built using Webpack

View on npm Outdated · Nov 3, 2026

wordpress-shortcode-webpack-plugin has 5 recorded weekly downloads on npm, a decrease of 64.3% over the past 30 days, ranking #3224 of 3,247 tracked listings.

Weekly downloads
5
Official API · Dec 5, 2026
7-day growth
-28.6%
-2 weekly downloads
30-day growth
-64.3%
-9 weekly downloads
90-day growth
-58.3%
-7 weekly downloads
Rank
#3224
▼ 171 in 7 days

About wordpress-shortcode-webpack-plugin

wordpress-shortcode-webpack-plugin

This Webpack plugin is for Wordpress developers who want an easy way to drop React apps into Wordpress pages. It creates a simple Wordpress plugin from your Webpack configuration, registering each Webpack entry as a Wordpress shortcode.

Requires Webpack 4 or 5

Installation

  npm install wordpress-shortcode-webpack-plugin

Usage

Import the plugin, tell it a bit about your desired Wordpress plugin output, and add it to your Webpack configuration.

webpack.config.js

import { WordpressShortcodeWebpackPlugin } from 'wordpress-shortcode-webpack-plugin';

export default {
    entry: './src/index.js',
    output: {
        filename: '[name].js',
    },
    plugins: [
        new WordpressShortcodeWebpackPlugin({
            // The name of the plugin in Wordpress. Should be kebab-cased
            wordpressPluginName: 'my-awesome-plugin',
            // Any additional fields to put in the plugin header.
            headerFields: {
                author: 'Tom Lagier',
                description: 'An awesome plugin that does many cool things'
                // Note: Defining a version isn't necessary for Wordpress cache-busting
                // if you're using [contenthash] tokens in your output. It can still be
                // nice to set a version for communicating changes to users.
                version: '1.2.3'
            }
        }),
    ],
}

When built, this will output the following assets in the build directory:

my-awesome-plugin/
  // The main Wordpress plugin file
  my-awesome-plugin.php
  assets/
    main.js
    ... other assets produced by Webpack

// Archive of the plugin that you can install to Wordpress
my-awesome-plugin.zip

Once uploaded, you can use the entrypoints specified in your Webpack configuration as shortcodes. By default the shortcodes are registered as {pluginName}-{entryName}. For our example, the one shortcode registered would be my-awesome-plugin-main.

So, in Wordpress, we could use the shortcode like [my-awesome-plugin-main].

You can see an example Create React App repo here.

Options

wordpressPluginName (required)

Type: string

Your plugin's name in kebab-case.

shortcodePrefix

Type: string<br/> Default: wordpressPluginName

The prefix used instead of wordpressPluginName to create your shortcodes. With shortcodePrefix: 'my-shortcode', the main entry shortcode would be [my-shortcode-main].

headerFields

Type:

{
  pluginUri?: string;
  description?: string;
  version?: string;
  requiredWordpressVersion?: string;
  requiredPHPVersion?: string;
  author?: string;
  authorUri?: string;
  license?: string;
  licenseUri?: string;
  textDomain?: string;
  domainPath?: string;
  isNetworkWide?: boolean;
}

Default: {}

Header fields for the Wordpress plugin. See https://developer.wordpress.org/plugins/plugin-basics/header-requirements/#header-fields

entryToRootId

Type: object <br/> Default: {}

A map of overrides for the root element ID for each entrypoint. By default we just use root as the ID for the root element, per React convention. If that ID conflicts with something else on the page, you can adjust it with this map.

{
    main: 'new-main-root-id'
}
pluginTemplate

Type: string <br/> Default: ./src/default-template.php (in the wordpress-shortcode-webpack-plugin repo)

Path to the template file that should be used to generate the Wordpress plugin file.

The template file is a PHP file with the following tokens that get replaced with content. You can customize the behavior of the Wordpress plugin by modifying the template.

{{plugin_header}}

Replaced with the Wordpress comment indicating the plugin name and other plugin metadata.

/**
 * Plugin Name: My Plugin
 */
{{asset_manifest}}

Replaced with an associative array of entrypoint to an array of files that should be loaded for that entrypoint. Required for {{shortcode_registration}} and {{shortcode_definitions}}.

$manifest = [
    'main' => [
        'main.js',
    ],
];
{{shortcode_definitions}}

Function that is invoked when the shortcode is called. Enqueues the assets for the entry and returns the React root HTML as a string.

Override this if you'd like to enhance the logic that gets run when your shortcode is run, e.g. by supplying attributes or setting global variables in the markup.

The naming convention for shortcodes that get registered is create_{entry}_app.

Requires {{shortcode_registration}}.

function create_main_app() {
    enqueue_assets('main');

    return '<div id="root"></div>';
}
{{shortcode_registration}}

Function that registers the shortcode definition functions and their assets with Wordpress.

function register_my_plugin_entries() {
    add_shortcode('my-plugin-main', 'create_main_app');
    register_assets('main');
}
{{add_action}}

Adds the {{shortcode_registration}} function as an action during Wordpress's init phase.

add_action('init', 'register_my_plugin_entries');

Build locally

Clone the project

  git clone https://github.com/studio-lagier/wordpress-shortcode-webpack-plugin

Go to the project directory

  cd wordpress-shortcode-webpack-plugin

Install dependencies

  yarn

Build

  yarn build

Running Tests

To run tests, run the following command

  yarn test

License

MIT

Description from the npm listing.

  • webpack
  • react
  • wordpress
  • webpack-plugin
  • wordpress-plugin

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

wordpress-shortcode-webpack-plugin weekly downloads on npm, last 90 days: 5 weekly downloads as of Dec 5, 2026, -58.3% over 90 days.wordpress-shortcode-webpack-pluginWeekly downloads on npm · Last 90 days5downloads / week-58.3% over 90 days01020304050Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
wordpress-shortcode-webpack-plugin weekly downloads on npm, last 90 days: 5 weekly downloads as of Dec 5, 2026, -58.3% over 90 days.

7/30/90-day growth

wordpress-shortcode-webpack-plugin weekly downloads growth on npm: -28.6% over 7 days, -64.3% over 30 days, -58.3% over 90 days.wordpress-shortcode-webpack-pluginWeekly downloads growth on npm5downloads / week now7-day growth-2 weekly downloads-28.6%30-day growth-9 weekly downloads-64.3%90-day growth-7 weekly downloads-58.3%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
wordpress-shortcode-webpack-plugin weekly downloads growth on npm: -28.6% over 7 days, -64.3% over 30 days, -58.3% over 90 days.

Ranking history

wordpress-shortcode-webpack-plugin npm ranking history: currently #3224 (by weekly downloads).wordpress-shortcode-webpack-pluginnpm ranking · by weekly downloads · Last 90 days#3224current rank#2000#2200#2400#2600#2800#3000#3200#3400Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 25 observations · Updated Dec 5, 2026pluginstats.com
wordpress-shortcode-webpack-plugin npm ranking history: currently #3224 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 162, #6 (overall #3,226)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins349 listings · 18 pages · page 18, #7 (overall #347)
Webpack plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (170)
Recent weekly downloads observations for wordpress-shortcode-webpack-plugin
Date (UTC)Weekly downloadsChange vs. previous
50
50
50
50
5+1
4+1
3-4
70
70
7-22
29+1
28-1
290
29—

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/wordpress-shortcode-webpack-plugin. First seen Oct 16, 2026; last successful collection Nov 3, 2026. See the methodology.