How to Create a WordPress Plugin

Today I'm goint to show you How to Create a WordPress Plugin.

Create a WordPress plugin is very easy. The really hard stuff is to code something cool (cache plugins, database plugins...).

In our first plugin we will add some easy lines just to show how it works.

Let's get started.

1. Create the php file

Create a new my_plugin.php file. We will fill it up with the code.

You can upload it to the wp-content/plugins directory of your WordPress site.

2. Plugin Information

Now we're going to write the plugin information.

This information will show up in your Installed Plugins page.

We will set the plugin version, the plugin author, plugin description and more...

Copy and paste this code below to your my_plugin.php file and change what you want:

3. Add some code

Now the plugin is already working. If you upload it you will be able to activate it but it won't do anything.

I will use some lines of How to post I did so we will have all those functions in one nice plugin.

Add those lines right after the plugin information we wrote before.


The plugin is working and can be used in any WordPress site.

Let's take a look to the final code:

Download My Plugin here


Feel free to comment your questions or suggestions.

Are you working on your own plugins?


Leave a Reply

Add <code> Some Code </code> by using this tags.