How to Create Site-Specific WordPress plugin

January 10, 2017

WordPress is one of the best content management system everyone knows that, it let’s you customize each single code within your site.

I was redesigning Softstribe and came across many errors like, sidebar disappearance, header missing and so on because I have custom codes in theme functions.php which was causing problems. Sooner I realized it and decided to create site-specific WordPress plugin to prevent errors.

Due to mess amount of custom functions in your functions.php file, your theme might become lazy and don’t properly work sometime. Also, it is not a good practice to put every new custom function in theme functions.php file. When you do development with your custom codes it is better to create separate site-specific plugin.

This is exactly why I’m writing this article.

How to create site-specific WordPress plugin

Following are the steps that you have to follow in order to create site-specific WordPress plugin:

  • Navigate to your file manage, where your WordPress installation is done
  • Go to wp-content/plugins
  • Create a new folder /wp-content/plugins/yoursitename-plugin/
  • With the same folder name, create yoursitename-plugin.php file inside blank plugin folder
  • Put the following code in the file:
<?php
/*
Plugin Name: Site Plugin for softstribe.com
Description: Site specific code changes for softstribe.com
*/
/* Start Adding Functions Below this Line */

/* Stop Adding Functions Below this Line */
?>

Check this, I have added the code below.

Login to your WordPress site and go to Plugins where you will see your plugin in inactive state.

Simply, click on activate link to activate the plugin.

Caution: Make sure that you don’t put function names with same names as your theme function because they will conflict with each other. Just create your own unique functions to put inside of your site-specific plugin.

Muhammad Dilawar
Muhammad Dilawar
Muhammad Dilawar is a WordPress developer and technical SEO specialist with over 12 years of experience building, optimizing, and maintaining websites. He specializes in WordPress, WooCommerce, server optimization, DNS, Cloudflare, website security, and performance improvements. Through Softstribe, he shares practical guides, tutorials, and industry insights based on real-world experience helping businesses grow their online presence.
More from Muhammad Dilawar