If you’ve ever run across some useful WordPress code to put into your functions.php file, then there’s a good chance you might want to use that code again at some point on another site.

Did you know that you can easily turn that bit of code into a simple plugin so you can easily reuse it wherever you like?

Below we’ll go over exactly how to do that.

We’ll use a piece of code that removes the bio box on a user’s profile page. Here’s where the bio box is normally.



Inserting Header Information

The first thing you’ll need is a simple text editor like Notepad for Windows or TextEdit for Mac.

There will be only two basic parts to this: some header information and then the code itself (i.e. the code originally meant for your functions.php file).

Information that typically goes into the header space in a plugin is the following:

That’s fine for a “professional” plugin, but as you will only be using this for your own purposes, you really don’t need all that info.

All you really need is the plugin name and a description of the plugin so that you can easily identify the plugin in your admin area.

And if you found the code you’ll be using somewhere on the web, you might want to put a link into the description (or in the Plugin URI spot) so that you know where it came from and can easily return there if needed.


Condensed Info Section

OK, so I’m going to make a condensed info section for my plugin.

In the top of text editor, I put the following:

So I gave it a name.

I put in the link where I found the code.

And then I gave it a description.


Insert Code Below Header Info

Next, simply paste the code you’re going to use below the header info. In my case, it’s the following:

original code


Saving the File

You’ll need to give your file a name and save it with a .php extension at the end.

For those using Notepad in Windows, in order to do this, you’ll need to put the whole name inside of quotations marks before saving it, or else it won’t save as a PHP file.

Mine looked like this as I was saving it.



Zip the File

Next, you’ll want to simply zip the file you’ve just saved. You can usually do this by right clicking.

(Note: Don’t put the file in a folder before zipping it. Simply zip the file itself.)


Upload and Activate

Next, simply upload your plugin and activate it as you would any other plugin.

Here’s how mine looks in the admin area.


And here’s it is in action. First, remember the old bio box.



Now with the plugin activated, the bio box is gone.



And that's it, a simple plugin that you can install into any site you like.