- In a file browser — your local operating system one if you’re using WAMP or MAMP, an (S)FTP client if you’re working on a remote server — open up your content directory. It’s usually
wp-content
. - In
wp-content
, open theplugins
folder. - Create a new folder inside of your
plugins
folder. Name it something likemyplugin
. - In that folder, create a file. The convention is to match your folder name with a
.php
at the end. This isn’t required though. But to fit that example, create a file calledmyplugin.php
. - In that folder, place in the plugin comment header. Modify it to match your desires. (That is, keep the things to the left of the colons (:), but change the things to the right to whatever you want them to be.
- Go into your WordPress admin area. On the page Plugins > Installed Plugins, you should now see the plugin you named in step 5. Activate your plugin.
- IF YOU WANT TO BREAK YOUR SITE, add a line of PHP to your file, like
die('my plugin was here');
. If you don’t want to break it, write some valid and non-breaking PHP instead. (That’s a big task, but we have to draw the line somewhere in this tutorial.
Here’s all the code from this tutorial in one block. A final warning: this code is intentionally capable of making your WordPress site break. die
is not a joke.
<?php
/*
Plugin Name: WPfastest Addons
Plugin URI: https://wpfastest.com/
Description: For Quick Guides
Version: 1.0.0
Author: WPfastest Addons
Author URI: https://wpfastest.com/
*/
die('my plugin was here');