Skip to content

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:

  1. Navigate to wp-content/plugins/ in your WordPress installation.
  2. Create a new folder with your plugin name, e.g., my-noob-plugin.
  3. Inside that folder, create a new PHP file with the same name:
my-noob-plugin/
│── my-noob-plugin.php  # Main plugin file
  1. 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 with 1.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 ⚑ ​

  1. Go to WordPress Dashboard β†’ Plugins
  2. Find My Noob Plugin in the list.
  3. Click Activate.

Congratulations! πŸŽ‰ Your plugin is now live, even though it does nothing yet!

Built by noobs, for noobs, with love πŸ’»β€οΈ