EnsureDomains
Free tool

WordPress Plugin Generator

Build a complete, standards-compliant WordPress plugin in your browser. Fill in the details, toggle the features you need — enqueued CSS and JS, custom post types, taxonomies, shortcodes, an admin settings page — and download an installable .zip. Free, private, GPLv2.

All free tools

Plugin details

Slug: my-awesome-plugin · Prefix: my_awesome_plugin_ · Text domain: my-awesome-plugin

Features

Every toggle adds real, wired-up code. All free — no paywall.

my-awesome-plugin/my-awesome-plugin.php
<?php
/**
 * Plugin Name:       My Awesome Plugin
 * Description:       A short description of what your plugin does.
 * Version:           1.0.0
 * Requires at least: 6.0
 * Requires PHP:      7.4
 * Author:            Your Name
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       my-awesome-plugin
 * Domain Path:       /languages
 *
 * @package My_Awesome_Plugin
 */

// Exit if accessed directly — never expose the file to direct requests.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

define( 'MY_AWESOME_PLUGIN_VERSION', '1.0.0' );
define( 'MY_AWESOME_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'MY_AWESOME_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'MY_AWESOME_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );

/**
 * Load the plugin's translations so all strings can be localized.
 */
function my_awesome_plugin_load_textdomain() {
	load_plugin_textdomain(
		'my-awesome-plugin',
		false,
		dirname( MY_AWESOME_PLUGIN_BASENAME ) . '/languages'
	);
}
add_action( 'init', 'my_awesome_plugin_load_textdomain' );

/**
 * Runs once when the plugin is activated.
 */
function my_awesome_plugin_activate() {
	// One-time setup: create options, custom tables, schedule cron, etc.
}
register_activation_hook( __FILE__, 'my_awesome_plugin_activate' );

/**
 * Runs once when the plugin is deactivated.
 */
function my_awesome_plugin_deactivate() {
	// Cleanup that belongs on deactivation (not uninstall): unschedule cron, etc.
}
register_deactivation_hook( __FILE__, 'my_awesome_plugin_deactivate' );

/**
 * Example shortcode — usage: [my_awesome_plugin_hello]
 *
 * @param array $atts Shortcode attributes.
 * @return string Escaped HTML output.
 */
function my_awesome_plugin_hello_shortcode( $atts ) {
	$atts = shortcode_atts(
		array(
			'name' => __( 'world', 'my-awesome-plugin' ),
		),
		$atts,
		'my_awesome_plugin_hello'
	);

	return sprintf(
		/* translators: %s: a name passed to the shortcode. */
		esc_html__( 'Hello, %s, from My Awesome Plugin!', 'my-awesome-plugin' ),
		esc_html( $atts['name'] )
	);
}
add_shortcode( 'my_awesome_plugin_hello', 'my_awesome_plugin_hello_shortcode' );

The slug, function prefix, constants and text domain are derived from your plugin name. Everything is generated in your browser — nothing is uploaded or stored. The .zip contains a ready-to-install my-awesome-plugin/ folder.

What you get

A real plugin, not a blank file

Every option produces correct, well-commented code that follows WordPress conventions — so your plugin works the moment you activate it.

Standards-compliant header

A proper plugin header docblock — name, version, author, license, requires-WP, requires-PHP, text domain and domain path — exactly how WordPress parses it.

ABSPATH security guard

Every PHP file starts by exiting if accessed directly, so the files can't be hit outside of WordPress.

Enqueue CSS & JS

Optional stylesheet and script wired through wp_enqueue_style and wp_enqueue_script — with an optional jQuery dependency.

Custom post types

Register a CPT with a full labels array, REST support, archives and a rewrite slug — ready for the block editor.

Custom taxonomies

Attach a hierarchical taxonomy to your post type with admin columns and REST support in one toggle.

Shortcodes

A working shortcode with shortcode_atts parsing and escaped, translatable output you can build on.

Admin settings page

A top-level menu, a registered setting with a sanitize callback, and a Settings API form that saves cleanly.

Translation-ready

load_plugin_textdomain plus a consistent text domain on every string, so the plugin is ready for i18n from day one.

GPLv2 licensed

Output is licensed GPL-2.0-or-later by default — the same license as WordPress core, free to use, modify and sell.

Installation

How to install your generated plugin

The upload method is the quickest. Prefer to work over SFTP? The manual method below drops the unzipped folder straight into your plugins directory.

  1. 1

    Download the .zip

    Configure your plugin above, then click Download plugin (.zip). The file is built in your browser and named from your plugin slug, e.g. my-plugin.zip.

  2. 2

    Open your WordPress dashboard

    Sign in to wp-admin and go to Plugins → Add New, then click the Upload Plugin button at the top of the page.

  3. 3

    Choose the .zip and install

    Select the .zip you downloaded, click Install Now, and WordPress unpacks the plugin folder into wp-content/plugins for you.

  4. 4

    Activate the plugin

    Click Activate. Your activation hook fires, rewrite rules flush if you added a custom post type, and the plugin is live.

Manual install (SFTP)

Unzip the download and upload the resulting folder to wp-content/plugins/, so you end up with wp-content/plugins/my-plugin/my-plugin.php. Then activate it from Plugins in wp-admin.

What's inside the .zip
my-plugin/the plugin folder (named from your slug)
my-plugin.phpmain file — always generated
uninstall.phpif uninstall cleanup is on
assets/
css/style.cssif a stylesheet is enabled
js/script.jsif a script is enabled
readme.txtWordPress-style readme — always generated
Under the hood

What's inside the boilerplate

Each generated piece exists for a reason. Here's what it does and the code behind it.

Plugin header

The docblock WordPress reads to list your plugin on the Plugins screen. Without it, WordPress won't recognise the file as a plugin.

/**
 * Plugin Name:       My Awesome Plugin
 * Version:           1.0.0
 * Requires at least: 6.0
 * Requires PHP:      7.4
 * License:           GPL-2.0-or-later
 * Text Domain:       my-awesome-plugin
 */

ABSPATH security guard

Stops the file from doing anything if it's requested directly instead of being loaded by WordPress.

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

Version & path constants

Reusable constants for the version (cache-busting), filesystem path and URL — defined once, used everywhere.

define( 'MY_AWESOME_PLUGIN_VERSION', '1.0.0' );
define( 'MY_AWESOME_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'MY_AWESOME_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

Activation & deactivation hooks

Run one-time setup on activation (and flush rewrite rules when you register a post type) and tidy up on deactivation.

function my_awesome_plugin_activate() {
    flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'my_awesome_plugin_activate' );

Text domain

Loads translations so every string wrapped in __() or esc_html__() can be localized.

function my_awesome_plugin_load_textdomain() {
    load_plugin_textdomain(
        'my-awesome-plugin',
        false,
        dirname( MY_AWESOME_PLUGIN_BASENAME ) . '/languages'
    );
}
add_action( 'init', 'my_awesome_plugin_load_textdomain' );

Optional features

Each toggle adds a self-contained, hooked block — like this escaped, translatable shortcode.

function my_awesome_plugin_hello_shortcode( $atts ) {
    return esc_html__( 'Hello from My Awesome Plugin!', 'my-awesome-plugin' );
}
add_shortcode( 'my_awesome_plugin_hello', 'my_awesome_plugin_hello_shortcode' );
Use cases

When should you use a plugin generator?

A generator earns its keep any time you'd otherwise paste code into a theme. A few common cases:

Site-specific functionality

Keep custom snippets out of functions.php. A small plugin survives theme switches and updates, and it can be activated or deactivated without touching your theme.

Client work

Ship a tidy, branded plugin per client with their name, URI and license in the header — instead of pasting loose code into the active theme.

Learning plugin structure

See how a real plugin is wired — hooks, the ABSPATH guard, constants, text domains and the Settings API — with correct, commented code to read.

Rapid prototyping

Spin up a CPT, a taxonomy and a settings page in seconds, install the .zip, and start iterating on the idea instead of the scaffolding.

Best practices

WordPress plugin development tips

The generator already follows these. Keep them in mind as you extend your plugin.

01

Prefix everything

Functions, constants, options and hooks all share one global namespace in WordPress. The generator prefixes every name from your slug so a plugin called "Acme Tools" uses acme_tools_ — no collisions with other plugins or core.

02

Escape all output

Never echo raw data. Use esc_html, esc_attr and esc_url on the way out, and sanitize_text_field on the way in. The generated shortcode and settings field already follow this pattern.

03

Use hooks, never edit core

Add actions and filters instead of changing WordPress or theme files. Edits to core are wiped on the next update; hooked code keeps working.

04

Keep functionality in a plugin

Code in the theme dies when the theme changes. Behaviour that should follow the site — a CPT, an integration, a shortcode — belongs in a plugin.

05

Version your plugin

Bump the Version header on every change and store it in a constant. WordPress uses it for cache-busting enqueued assets and for showing update notices.

Generated in your browser

Nothing you type is uploaded or stored. The plugin and its .zip are built entirely on your device.

WordPress plugin questions, answered

What does this generator produce?

A complete, installable WordPress plugin. You always get the main PHP file (with the plugin header, ABSPATH guard, version and path constants, and text-domain loading) plus a WordPress-style readme.txt. Each feature you toggle on adds real, wired-up code: enqueued CSS and JS, a custom post type, a custom taxonomy, a shortcode, an admin settings page, activation/deactivation hooks, and an uninstall.php cleanup file. The download is a .zip with the correct folder structure.

How do I install the generated plugin?

Download the .zip, then in your WordPress dashboard go to Plugins → Add New → Upload Plugin, choose the .zip, click Install Now and then Activate. You can also unzip it manually and copy the resulting folder into wp-content/plugins, then activate it from the Plugins screen.

Is it free?

Yes — the generator is completely free and there is no paywall. Every feature toggle is available to everyone, and the code it produces is yours to use.

Can I use or sell the plugin commercially?

Yes. The output is licensed GPL-2.0-or-later by default — the same license as WordPress itself. You can use it on unlimited sites, modify it, bundle it into client work, and sell it. There is no attribution requirement to EnsureDomains.

What does GPLv2 mean?

The GNU General Public License v2 is a free-software license. It lets anyone run, study, modify and redistribute the code, including commercially. If you distribute a modified version, you pass on the same freedoms under the same license. WordPress and most of its ecosystem use it.

Is my data private?

Yes. The entire plugin — every file and the .zip itself — is generated in your browser with JavaScript. Nothing you type is uploaded, logged or stored on a server. You can disconnect from the internet after the page loads and it still works.

Does it support custom post types and shortcodes?

Yes. Toggle on the custom post type feature and set the singular label, plural label and slug; the generator writes a register_post_type call with a full labels array, REST support and an archive. You can also attach a custom taxonomy. The shortcode toggle adds a working, escaped, translatable [prefix_hello] shortcode.

What WordPress and PHP version does it require?

The defaults are WordPress 6.0 and PHP 7.4, written into the plugin header as Requires at least and Requires PHP. You can change both in the form to match your environment. The generated code uses widely-supported APIs and runs on current WordPress and PHP releases.

How is this different from a code-snippets plugin?

A snippets plugin runs loose PHP inside another plugin's context. This generator produces a real, self-contained plugin: its own folder, header, activation hooks and uninstall routine. It's versioned, portable between sites, survives theme changes, and can be reviewed, committed to version control and distributed on its own.

Where do I put my CSS and JS?

Enable the stylesheet and script features and the generator creates assets/css/style.css and assets/js/script.js, already enqueued via wp_enqueue_style and wp_enqueue_script on the wp_enqueue_scripts hook. Write your styles and behaviour in those files — the enqueue wiring is done.

How do I add my own functions?

Open the main PHP file and add your functions below the generated code, keeping the same prefix to avoid name collisions. Hook them onto WordPress actions and filters with add_action and add_filter. The generated functions are a working example of the pattern to follow.

Launchpad Premium

The best names never reach the public list.

Behind every brandable name we publish are the ones we hold back — reserved, high-value domains with a brand concept already built. Launchpad Premium is where you see them first.

  • First access to reserved, high-value names
  • A ready-made brand concept with every domain
  • Price-drop alerts on the names you're watching