WordPress
WordPress plugin generator
Use this WordPress plugin generator to create a small, standards-based starter plugin, or boilerplate, with its own PHP namespace and an optional settings page. Check each file before you download the ZIP, then build your own features on top.
- Own PHP namespace
- Optional settings page
- ZIP made in your browser
Free, no sign-up. It runs in your browser, so nothing you type is sent to this site.
Nothing you enter leaves your browser.
This tool runs in your browser and needs JavaScript. Turn JavaScript on and reload the page.
Plugins
Your plugin
Your plugin will appear here
Complete the fields to see the plugin folder.
Your output will appear here
Complete the fields to generate valid output.
Check before you activate
What you can do
-
Plugin headers, folder name and PHP namespace
-
Optional settings page with a cleaned text field
-
Optional clean-up of the setting on uninstall
-
File previews and copying
-
Plugin ZIP built in your browser
How to create a WordPress plugin
-
Name the plugin
Enter the plugin name, a unique folder name and namespace, then review the version, author and licence details.
-
Choose the extras
Decide whether to add a settings page and uninstall clean-up, then read the generated PHP and readme.txt.
-
Install and test
Download the ZIP and upload it in Plugins, Add New, Upload Plugin. Activate and test it on a staging site before you add your own features.
A starting point for your own plugin
This free plugin generator writes the files of a small WordPress plugin in your browser: the main PHP file, readme.txt and, if you want it, uninstall.php. The ZIP is made in your browser too, so nothing is sent to this site.
Install and test your plugin
- Start on staging. Back up the site and choose a folder name and namespace that no other plugin uses. Review each file before you download.
- Upload the ZIP. In WordPress, open Plugins, Add New, Upload Plugin, choose the ZIP, then install and activate it. The archive holds one plugin folder, and uploading a folder that already exists can replace its files.
- Check the starter. Visit the site and the dashboard, check the PHP error log and confirm there are no errors. With the settings page, open Settings, then your plugin's name, save a test message and check that it stays saved.
- Edit in your code editor. Unzip the files on your computer and add your own actions and filters to the main PHP file. Deploy changes through your normal staging process and raise the version number. Avoid editing PHP on a live site.
What the starter does
The main file has the WordPress plugin headers, a namespace and a guard against direct access. The optional settings page adds one text setting that needs the manage_options capability, checks a WordPress nonce, cleans the value with sanitize_text_field() and escapes it on output. Without that option the plugin registers no settings and stores nothing, so activating it changes nothing on its own.
What to add yourself
Add the features your site needs, with validation, permission checks and escaped output for each one. If you rename the namespace, keep every callback in step with it, and start new option names with your plugin's folder name. Before you share the plugin, choose a licence and include its text. This generator does not test compatibility, set up updates or publish to WordPress.org.
Deactivation and deletion
Deactivating the plugin keeps its data. The optional uninstall clean-up runs only when WordPress deletes the plugin, and it removes the one example setting for the current site. It does not delete posts, other settings or tables, so adapt and test it if your plugin later stores more.
Read the Plugin Handbook, including plugin headers, the Settings API and uninstall methods.
Changing how a theme looks? Use the child theme generator. To activate it from the command line, use the WP-CLI command builder.
Frequently asked questions
Which plugin header fields are required?
Only Plugin Name is required. The generator also fills in Description, Version, Requires at least, Requires PHP, Author, License and Text Domain from your answers, where you give them.
How do I install the generated plugin?
In WordPress, go to Plugins, Add New Plugin, Upload Plugin, choose the ZIP and activate it. Or unzip it into wp-content/plugins and activate it there.
What is the difference between deactivating and deleting?
Deactivating stops the code but keeps its data. Deleting removes the files and, if you included the uninstall clean-up, its one example setting.
Should I use a plugin or my theme’s functions.php?
Use a plugin for features that should keep working when you change themes. Keep theme files for how the site looks.
Related tools
-
Child themes
Create a WordPress child theme with style.css, functions.php and a ZIP download.
-
WP-CLI commands
Build explained WP-CLI commands for installing and maintaining WordPress.
-
wp-config.php
Generate a wp-config.php with database settings, new salt keys and explained options.