We build easy to manage, secure and Mobile friendly Websites.

How to create WordPress Plugin File

In this tutorial, I will show you how to create WordPress plugin file with its header as shown in above.

  • Navigate to the WordPress Plugin directory (wp-content/plugins)
  • Create a new sub directory in the plugin folder called my-plugin
  • Navigate to this directory and create a new PHP file called my-plugin.php
  • Open the my-plugin.php file and add the following text below:
 * Plugin Name:       My Plugin
 * Plugin URI:        https://mypluginurl.com
 * Description:       This is my new plugin
 * Version:           1..0.0
 * Requires at least: 5.2
 * Requires PHP:      7.2
 * Author:            Author Name 
 * Author URI:        https://author-url.com
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       my-plugin
 * Domain Path:       /languages
  • save and close the file.
  • Login to WordPress Admin page and go to WordPress dashboard, select plugin tab, you will see that My Plugin is part of the listed plugin.
  • Enable the plugin by clicking Activate.
  • You have successfully created a plugin file with its header.

Leave a Reply

Your email address will not be published. Required fields are marked *