Step 2: Setting Up Your Plugin β
Creating the Plugin Folder & Files π β
Every WordPress plugin lives inside the wp-content/plugins/
directory. To create a new plugin, follow these steps:
- Navigate to
wp-content/plugins/
in your WordPress installation. - Create a new folder with your plugin name, e.g.,
my-noob-plugin
. - Inside that folder, create a new PHP file with the same name:
my-noob-plugin/
βββ my-noob-plugin.php # Main plugin file
- Open the file in a code editor.
Understanding the plugin.php
(my-noob-plugin.php
) File π β
The main plugin file must include a header comment so WordPress recognizes it.
Paste this into your my-noob-plugin.php
file:
php
<?php
/**
* Plugin Name: My Noob Plugin
* Plugin URI: https://developernoob.com
* Description: A simple WordPress plugin to do noob things!
* Version: 1.0.0
* Author: Your Noob Name
* Author URI: https://yourwebsite.com
* License: GPL-2.0+
*/
πΉ What These Lines Mean: β
Plugin Name:
The official name of your plugin.Plugin URI:
A link to your pluginβs homepage (optional).Description:
A short description of what your plugin does.Version:
The version number (start with1.0.0
).Author:
Your name or company name.License:
Always use GPL-2.0+ to meet WordPress guidelines.
Once this file is saved, your plugin will appear in the WordPress admin under Plugins! π
Activating Your Plugin β‘ β
- Go to WordPress Dashboard β Plugins
- Find My Noob Plugin in the list.
- Click Activate.
Congratulations! π Your plugin is now live, even though it does nothing yet!