A WordPress plugin header is the PHP comment block at the top of a plugin’s main file that tells WordPress the file is a plugin. Only Plugin Name is required. The other 14 fields (Plugin URI, Description, Version, Requires at least, Requires PHP, Author, Author URI, License, License URI, Text Domain, Domain Path, Network, Update URI and Requires Plugins) are optional, but several of them control real behavior: activation checks, updates, translations and plugin dependencies. Below is every field, what it does, and the mistakes I see most.
Most developers copy a WordPress plugin header from an old project or a boilerplate and never look at it again. That works until something odd happens: the plugin gets overwritten by an update for a different plugin, refuses to activate on an older site, or shows up in the Plugins list with half its description missing.
Every one of those problems traces back to the header. This guide goes through each field the official Plugin Handbook lists, checked against the header requirements page and the WordPress core functions that read it. I build custom plugins and have published my own on WordPress.org, so I’ll also point out which fields matter in practice and which are mostly decoration.
Table of Contents
What is a WordPress plugin header?
A WordPress plugin header is a specially formatted PHP block comment in your plugin’s main file. WordPress scans that comment to decide whether the file is a plugin and to read its name, version, author and requirements. Without it, WordPress doesn’t list the plugin at all.
A few rules from the handbook and core code are worth knowing before you write one:
- It goes in the main PHP file, usually named after the plugin, such as
my-plugin/my-plugin.php. - Only one file should have it. The handbook’s Plugin Basics page says only one file in the plugin’s folder should carry the header comment.
- It must be near the top. WordPress reads headers with
get_file_data(), which only looks at the first 8 KB of the file. - One field per line. Fields can’t span multiple lines. A value is cut at the end of its first line.
The minimum WordPress plugin header
The smallest valid WordPress plugin header has one field:
<?php /* * Plugin Name: My Plugin */
That’s enough for WordPress to list and activate the plugin. It’s fine for a quick snippet plugin on your own site. For anything you ship to a client or publish, you’ll want more fields, because several of them affect how WordPress treats the plugin.
A complete WordPress plugin header example
Here’s a full WordPress plugin header using all the fields from the handbook except Network, which you only add for network-only plugins. The values are placeholders:
<?php /* * Plugin Name: Sample Booking Notes * Plugin URI: https://example.com/plugins/booking-notes/ * Description: Adds private staff notes to booking records. * Version: 1.4.0 * Requires at least: 6.5 * Requires PHP: 7.4 * Author: Your Name * Author URI: https://example.com/ * License: GPL v2 or later * License URI: https://www.gnu.org/licenses/gpl-2.0.html * Update URI: https://example.com/plugins/booking-notes/ * Text Domain: booking-notes * Domain Path: /languages * Requires Plugins: woocommerce */
The aligned spacing is just for readability. WordPress doesn’t care about it. The asterisks at the start of each line are optional too, but most coding standards use them.
Every WordPress plugin header field explained

This table covers every field listed in the official handbook. Only the first one is required.
| Field | Required? | What it does |
|---|---|---|
| Plugin Name | Yes | Name shown in the Plugins list in wp-admin |
| Plugin URI | No | The plugin’s home page. Must be unique to the plugin, and not a WordPress.org URL |
| Description | No | Short summary in the Plugins list. Keep it under 140 characters |
| Version | No | Current version, such as 1.0 or 1.0.3 |
| Requires at least | No | Lowest WordPress version the plugin works on |
| Requires PHP | No | Minimum PHP version |
| Author | No | Author name. Multiple authors separated by commas |
| Author URI | No | Author’s website or profile |
| License | No | Short license name, such as GPLv2 |
| License URI | No | Link to the full license text |
| Text Domain | No | The gettext text domain for translations |
| Domain Path | No | Where WordPress finds translation files |
| Network | No | Set to true only if the plugin can only be network-activated |
| Update URI | No | Stops a third-party plugin being overwritten by a WordPress.org plugin with a similar slug |
| Requires Plugins | No | Comma-separated WordPress.org slugs of plugins this one depends on |
Where do these values show up? On the Plugins screen, WordPress displays the name, description, version and author from the WordPress plugin header, with links built from Plugin URI and Author URI. Other fields never appear on screen but still change behavior: the requirement fields block activation on sites that don’t meet them, Update URI changes how updates are checked, and Requires Plugins links your plugin to its dependencies. That’s why a careless WordPress plugin header can cause problems that look like bugs in the code.
The rest of this post goes through the fields that cause the most confusion, starting with the one people search for most.
Plugin URI in WordPress: what goes there?
The Plugin URI field is the plugin’s home page. In wp-admin, WordPress uses it for the “Visit plugin site” link under the plugin’s description. The handbook says it should be a unique URL, preferably on your own website, and that you can’t use a WordPress.org URL here.
Three fields in a WordPress plugin header take URLs, and they’re easy to mix up:
| Field | Points to | Example |
|---|---|---|
| Plugin URI | A page about this plugin | https://example.com/plugins/booking-notes/ |
| Author URI | The author’s site or profile | https://example.com/ |
| Update URI | An identifier for where updates come from | https://example.com/plugins/booking-notes/ |
A common mistake is setting Plugin URI to the author’s home page, or to the same URL across several plugins. Give each plugin its own page, even if it’s a short one. For a private client plugin with no public page, leave Plugin URI out rather than pointing it somewhere meaningless.
Version: why 1.10 isn’t always bigger than 1.9
The Version field looks simple, but WordPress compares versions with PHP’s version_compare() function. The handbook gives a warning example: 1.02 is actually greater than 1.1. Before you release, check that the new number compares as greater than the old one.
My advice: use plain three-part numbers like 1.4.0, 1.4.1, 1.5.0 and never use leading zeros. Keep the version in the WordPress plugin header in sync with any version constant in your code and, if the plugin is on WordPress.org, with the Stable tag in readme.txt.
Requires at least and Requires PHP
These two fields aren’t just information. WordPress checks them before activating a plugin. The validate_plugin_requirements() function, introduced in WordPress 5.2, reads Requires at least, Requires PHP and Requires Plugins from the main plugin file. Since WordPress 5.8, it no longer falls back to readme.txt, so these values must be in the WordPress plugin header itself.
Set them honestly. If you use a PHP 8.0 feature, say Requires PHP: 8.0. A site on an older version then gets a clear message instead of a fatal error. Don’t set them higher than you need either, or you lock out sites that would have worked fine.
Text Domain and Domain Path
These two fields handle translations. The internationalization guide says the text domain must match the plugin’s slug. If your plugin lives in a folder called booking-notes, the text domain is booking-notes. The same guide notes that since WordPress 4.6 the Text Domain header is optional because it must match the slug anyway, but there’s no harm in including it.
Domain Path tells WordPress where your translation files are, relative to the plugin folder, such as /languages. If you don’t ship translation files inside the plugin, you can leave it out.
License and License URI
License takes a short name like GPLv2 or “GPL v2 or later”. License URI links to the full text. WordPress doesn’t enforce either field when activating a plugin.
They do matter if you publish on WordPress.org. The first rule in the detailed plugin guidelines is that plugins must be compatible with the GNU General Public License. For client work, state the license anyway. It removes any doubt about who can reuse the code later.
Network: only for multisite-only plugins
Network is for WordPress multisite. Setting Network: true means the plugin can only be activated network-wide by a super admin, not on individual sites. The handbook says it can only be set to true and should be left out when not needed.
Older plugins sometimes use Site Wide Only: true. Core still reads it, but it has been deprecated since WordPress 3.0 in favor of Network. If you maintain an old plugin with that line, replace it.
Update URI: protect custom plugins from wrong updates
This is the field I add to almost every custom WordPress plugin header I write. Before WordPress 5.8, a custom plugin that happened to share a slug with a plugin on WordPress.org could be “updated” with that unrelated plugin, wiping out the custom code.
The Update URI dev note explains the fix. If Update URI is set to anything other than the plugin’s WordPress.org address, WordPress won’t try to update it from WordPress.org. Values can be a URL on your own domain, a plain name, or false. WordPress 5.8 also added an update_plugins_{$hostname} filter, so a custom updater can handle updates for that hostname.
Plugins hosted on WordPress.org don’t need this field. For private client plugins, it’s cheap insurance, and it makes routine WordPress maintenance tasks like bulk plugin updates much safer.
Requires Plugins: declaring dependencies
Requires Plugins arrived in WordPress 6.5. It’s a comma-separated list of WordPress.org slugs, such as woocommerce. File paths like my-plugin/my-plugin.php aren’t supported, and slugs can’t contain commas.
Per the plugin dependencies dev note, a plugin that declares dependencies can’t be installed until they’re installed, or activated until they’re activated. The dependency can’t be deactivated while a dependent plugin is active. Plugins not hosted on WordPress.org can declare dependencies too, but WordPress won’t offer an install link for third-party dependencies, so users install those manually.
If your plugin is a WooCommerce add-on, this field saves you a lot of “WooCommerce is not active” checking code. Keep a simple runtime check anyway for sites running an older WordPress version.
WordPress plugin header vs readme.txt
People often confuse the WordPress plugin header with the readme.txt file. They overlap, but they do different jobs:
| Plugin header | readme.txt | |
|---|---|---|
| Read by | WordPress core on every site | The WordPress.org Plugin Directory |
| Required for | Any plugin to work | Plugins published on WordPress.org |
| Unique fields | Plugin URI, Text Domain, Domain Path, Network, Update URI, Requires Plugins | Contributors, Tags, Tested up to, Stable tag, the long description, FAQ and changelog |
| Shared fields | Requires at least, Requires PHP, License, License URI | The same values, which should match |
For a private plugin, you only need the WordPress plugin header. For a WordPress.org plugin, you need both, and the shared values should agree.
Reading header data in your own code
Sometimes you need your plugin’s version or name in code, for cache-busting assets or showing the version on a settings page. WordPress provides get_plugin_data(), which parses the header for you. It lives in an admin file, so load that file first if you call it outside wp-admin:
if ( ! function_exists( 'get_plugin_data' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$data = get_plugin_data( __FILE__ );
$version = $data['Version'];
For something called on every request, a constant is cheaper than parsing the file each time. Just remember to update it alongside the header:
define( 'BOOKING_NOTES_VERSION', '1.4.0' );
You can also add your own header fields. get_file_data() applies a filter named extra_{$context}_headers, which for plugins is extra_plugin_headers. I rarely need this, but it’s useful for internal metadata like a client reference.
Common WordPress plugin header mistakes

- Header in two files. A copied file with its own header shows up as a second plugin in the list.
- Header too far down. A long license block or code above it can push fields past the first 8 KB, and WordPress won’t see them.
- Multi-line Description. Only the first line is read, so the rest of the description disappears.
- Plugin URI pointing to WordPress.org, which the handbook says you can’t use.
- No Update URI on a custom plugin with a generic slug, risking an overwrite from the directory.
- Wrong Requires PHP, set from a boilerplate rather than from the code’s actual needs.
- Text Domain that doesn’t match the folder slug, so translations don’t load.
Who needs to care about every field
If you write small snippet plugins for your own site, Plugin Name, Description and Version are enough. You don’t need to fill in every WordPress plugin header field for a ten-line plugin that disables comments.
If you build plugins for clients as part of WordPress website development, sell them, or publish on WordPress.org, every field is worth a minute. Requires PHP, Update URI and Requires Plugins in particular prevent support problems you’d otherwise discover months later on someone else’s server.
Frequently asked questions
What is the only required WordPress plugin header field?
Plugin Name. A header comment containing just the Plugin Name line is enough for WordPress to list and activate the plugin. Every other field is optional.
What should I put in the Plugin URI field?
A unique page about the plugin, preferably on your own site. The Plugin Handbook says it must be unique to the plugin and can’t be a WordPress.org URL. For a private plugin without a public page, leave it out.
What is the difference between Plugin URI and Author URI?
Plugin URI points to a page about the specific plugin. Author URI points to the author’s own website or profile. Each plugin should have its own Plugin URI, while Author URI is usually the same across all your plugins.
Do I need Update URI for a plugin hosted on WordPress.org?
No. Update URI is for plugins outside the directory. It stops WordPress from replacing a custom plugin with an update for a WordPress.org plugin that has a similar slug.
Does WordPress enforce Requires PHP and Requires at least?
Yes. Since WordPress 5.2, core checks these before activation, and since 5.8 it reads them only from the main plugin file, not readme.txt. Requires Plugins is checked too, since WordPress 6.5.
Can I add custom fields to a WordPress plugin header?
Yes. Use the extra_plugin_headers filter to register extra header names, and they’ll be read along with the standard fields by get_file_data().
Need a custom WordPress plugin built properly?
I build custom WordPress plugins with clean headers, honest requirements and safe update handling, so they don’t break on a client’s server a year later. My WordPress developer service lists custom plugins from $199 and small fixes from $25, with hourly work at $15. If you’ve got a plugin idea or an old plugin that needs cleaning up, send me the details.
