Plugin Header Generator
Write the header block and bootstrap for a plugin's main PHP file, without hunting for the field names.
What this tool does
Plugin Header Generator produces a whole main plugin file, not a snippet to paste somewhere: the opening PHP tag, the docblock WordPress reads when it builds the Plugins screen, and — if you ask for it — the code beneath that prepares the plugin to do work. WordPress only recognises a plugin when that header sits in a PHP file directly inside the plugin's own folder, so the summary line names the exact path to save the output at, in the form slug/slug.php.
The folder name doubles as the text domain, and both are derived from the plugin name by folding accents, dropping punctuation and turning spaces into hyphens (underscores survive), unless you set the folder field yourself. That single slug then drives the Text Domain line, the PHP function prefix, the four uppercase constants and the PascalCase class name, so those never drift apart. Domain Path is always written as /languages. Plugin URI and Author URI are normalised to a full https:// address with any trailing slash removed, so typing example.com/reading-time is enough.
Version is the one field that is checked rather than copied. It has to be one to four dot-separated numbers with an optional pre-release suffix, because that is the shape WordPress can compare when it decides whether an update is newer; something like "one point oh" is refused with an error instead of being written into a header that would quietly break update checks. The Body setting decides how much comes after the docblock: header only, header plus an ABSPATH guard with version, file, path and URL constants and activation and deactivation hooks, or header plus a singleton class with an instance() accessor wired to the init action.
The limits are worth knowing before you start. This writes one file and nothing else — no readme.txt, no /languages directory, no .pot template, no licence file and no zip, so a plugin meant for the wordpress.org directory still needs the readme written by hand. The generated body is scaffolding: the init function only loads the text domain, and the activation and deactivation hooks only flush rewrite rules, which is useful if you go on to register post types or rewrites and pointless if you do not. Requires at least and Requires PHP are passed through exactly as typed with no validation, only Version is checked, and nothing here can tell you whether the slug you picked is already taken on wordpress.org.
How to use it
- Name the plugin. This is the name shown on the Plugins screen. Leave the folder field empty and the slug, text domain, constant prefix and class name are all derived from it.
- Describe it in the input box. One or two sentences; line breaks and runs of spaces are collapsed into a single line. Leave it empty and the Description field falls back to a plain sentence rather than being written blank.
- Fill in the plugin meta you actually have. Author, Author URI, Plugin URI, the minimum WordPress and PHP versions, the licence. Fields left empty are omitted from the header entirely instead of appearing with nothing after the colon.
- Choose how much body to generate. Header only for a file you will write yourself, guards and hooks for a small procedural plugin, or the singleton class for anything past a couple of functions.
- Set Network-only or Update URI if they apply. Network writes Network: true, which makes the plugin network-activate-only on multisite. Update URI needs a Plugin URI to point at, and the job is refused if you tick it without one.
- Save the output at the path in the summary. Create the folder under wp-content/plugins, save the file inside it with the same name, and the plugin appears on the Plugins screen ready to activate.
Processing & privacy
Runs on your device. Your file is processed directly in this browser.
Common use cases
Promoting functions.php snippets into a real plugin
Code in a theme's functions.php dies with the theme. A generated bootstrap gives those snippets a file of their own that survives a redesign.
Getting the text domain right before any translation work
The Text Domain has to match the folder for translations to load. Deriving both from one slug removes the mismatch that leaves strings stubbornly untranslated.
Keeping a private plugin off the update path
A plugin whose slug collides with a public one can be overwritten by an update from wordpress.org. Update URI, written alongside a Plugin URI, tells WordPress to leave it alone.
Checking a header you inherited
Generate a correct block for the same plugin and compare field names and spelling against the file you were handed, rather than guessing which line WordPress is ignoring.
Questions
Is anything uploaded?
Where exactly does the file go?
What does the header-only option leave out?
Does it write readme.txt or the translation files?
Why was my version number rejected?
Are the WordPress and PHP requirements validated?
What does the licence choice change?
Related tools
- Meta Tag Preview — See how your title and description look in search results.
- Salt Key Generator — Produce a new set of WordPress authentication salts.
- wp-config Generator — Generate a wp-config.php with fresh security salts.
- .htaccess Generator — Build common Apache rules for WordPress.
- Serialized Data Fixer — Repair PHP serialized strings broken by search-replace.
- Shortcode Builder — Assemble shortcodes with attributes correctly quoted.