<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WPWife &#187; why do you need a site-specific wordpress plugin</title>
	<atom:link href="http://www.wpwife.com/category/why-do-you-need-a-site-specific-wordpress-plugin/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wpwife.com</link>
	<description>WPHelp: fix and optimise WP themes&#38;plugins</description>
	<lastBuildDate>Fri, 21 Nov 2025 12:00:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.38</generator>
	<item>
		<title>What, Why, and How-To’s of Creating a Site-Specific WordPress Plugin</title>
		<link>http://www.wpwife.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin</link>
		<comments>http://www.wpwife.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin#comments</comments>
		<pubDate>Thu, 08 Feb 2018 14:05:33 +0000</pubDate>
		<dc:creator><![CDATA[Editorial Staff]]></dc:creator>
				<category><![CDATA[Beginners Guide]]></category>
		<category><![CDATA[how to create a site-specific wordpress plugin]]></category>
		<category><![CDATA[site-specific wordpress plugin]]></category>
		<category><![CDATA[what is a site-specific plugin for wordpress]]></category>
		<category><![CDATA[why do you need a site-specific wordpress plugin]]></category>
		<category><![CDATA[wordpress functionality plugin]]></category>

		<guid isPermaLink="false">http://www.wpbeginner.com/?p=4948</guid>
		<description><![CDATA[
<p>Do you want to add a site-specific plugin to your WordPress website? A site-specific plugin allows you to easily add code snippets to your WordPress website without relying on your theme. In this article, we will explain how to create a site specific WordPress plugin&#8230;&#160;<strong><a href="http://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/">Read More &#187;</a></strong></p>
<p>The post <a rel="nofollow" href="http://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/">What, Why, and How-To&#8217;s of Creating a Site-Specific WordPress Plugin</a> appeared first on <a rel="nofollow" href="http://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Do you want to add a site-specific plugin to your WordPress website? A site-specific plugin allows you to easily add code snippets to your WordPress website without relying on your theme. In this article, we will explain how to create a site specific WordPress plugin and why it&#8217;s important. </p>
<p><img title="Site Specific WordPress Plugin"  src="http://cdn.wpbeginner.com/wp-content/uploads/2011/12/sitespecificplugin.png" alt="Site Specific WordPress Plugin" width="550" height="340" class="alignnone size-full wp-image-50361" /></p>
<h4>What is a Site-Specific WordPress Plugin</h4>
<p>A site-specific WordPress plugin is a standalone plugin that you can use to add all customization snippets that are not theme dependent.</p>
<p>When working on your website, you&#8217;ll often find <a href="http://www.wpbeginner.com/category/wp-tutorials/" title="WordPress Tutorials - 200+ Step-by-Step WordPress Tutorials">WordPress tutorials</a> asking you to add code to your theme&#8217;s <a href="http://www.wpbeginner.com/glossary/functions-php/" title="What is functions.php file in WordPress?">functions.php file</a> or a site-specific plugin. </p>
<p>WordPress doesn&#8217;t come with a site-specific plugin. You&#8217;ll need to create your own and then install / activate it. </p>
<h4>Why Create a Site-Specific WordPress Plugin?</h4>
<p>As we mentioned earlier that you&#8217;ll often come across tutorials showing some code that you can add to your theme&#8217;s <a href="http://www.wpbeginner.com/glossary/functions-php/" title="What is functions.php file in WordPress?">functions.php file</a> or a site-specific plugin. </p>
<p>These custom codes can be used to add new <a href="http://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/" title="How to Create Custom Post Types in WordPress">post types</a>, <a href="http://www.wpbeginner.com/wp-tutorials/create-custom-taxonomies-wordpress/" title="How to Create Custom Taxonomies in WordPress">taxonomies</a>, <a href="http://www.wpbeginner.com/wp-tutorials/how-to-add-a-shortcode-in-wordpress/" title="How to Add A Shortcode in WordPress?">shortcodes</a>, and tons of hacks to improve your website. </p>
<p>If you add the custom code to your theme&#8217;s functions file, then it will disappear if you update or switch your theme. You can <a href="http://www.wpbeginner.com/beginners-guide/wordpress-child-theme-pros-cons/" title="What is a WordPress Child Theme? Pros, Cons, and More">create a child theme</a> and use the child theme&#8217;s functions file to save your code. However, your code will still disappear if you switch themes.  </p>
<p>A site-specific WordPress plugin allows you to easily <a href="http://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/" title="Beginner’s Guide to Pasting Snippets from the Web into WordPress">add custom code snippets to your WordPress</a> website and make sure they&#8217;re theme independent. It is a standalone WordPress plugin which means it doesn&#8217;t depend on your theme, and you are free to update or switch your theme. </p>
<p>That being said, let&#8217;s take a look at how to easily add custom code using site-specific plugin. We will show you two ways to do that, and you can choose the method that works best for you (hint Method #2 is easier for beginners).</p>
<h4>Method 1. Manually Create a Site-Specific WordPress Plugin</h4>
<p>We know this may sound a bit geeky to beginners, but we will try to make it as simple as possible for you. </p>
<p>First you need to create a new folder on your desktop and name it after your website for example, mywebsite-plugin. </p>
<p><img title="Creating your site-specific plugin folder" src="http://cdn2.wpbeginner.com/wp-content/uploads/2018/02/pluginfolder.jpg" alt="Creating your site-specific plugin folder" width="550" height="232" class="alignnone size-full wp-image-50278" /></p>
<p>Now open a plain text editor on your computer like Notepad or TextEdit. You need to create a new file and save it as mywebsite-plugin.php in the plugin folder on your desktop. </p>
<p><img title="Creating the plugin file for your site-specific plugin" src="http://cdn3.wpbeginner.com/wp-content/uploads/2018/02/pluginfile.jpg" alt="Creating the plugin file for your site-specific plugin" width="550" height="226" class="alignnone size-full wp-image-50279" /></p>
<p>Your plugin file needs specific header code so that WordPress can recognize it as a plugin. Go ahead and add the following code to your mywebsite-plugin.php file: </p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/*
Plugin Name: Site Plugin for example.com
Description: Site specific code changes for example.com
*/
/* Start Adding Functions Below this Line */
 
 
/* Stop Adding Functions Below this Line */
?&gt;
</pre>
<p>You can replace example.com with your own domain name. Once you do that, your site-specific plugin is ready. </p>
<p>There are two ways to upload your site-specific plugin to your website. You can either upload it via your WordPress admin panel or use FTP.</p>
<p><strong>1. Install Site-Specific Plugin from WordPress Admin Area</strong> </p>
<p>This method is easier and recommended for all users. </p>
<p>First, you need to create a zip file of your site-specific plugin folder. </p>
<p>Windows users can simply right-click on plugin folder and select <strong>Send to &raquo; Compressed (zip) folder</strong>. </p>
<p><img title="Creating zip file in Windows" src="http://cdn3.wpbeginner.com/wp-content/uploads/2018/02/zipfolder-windows.jpg" alt="Creating zip file in Windows" width="550" height="305" class="alignnone size-full wp-image-50280" /></p>
<p>Mac users need to right-click and select &#8220;Compress mywebsite-plugin&#8221;. </p>
<p><img title="Creating a zip folder on Mac" src="http://cdn2.wpbeginner.com/wp-content/uploads/2018/02/zipfolder-mac.jpg" alt="Creating a zip folder on Mac" width="550" height="293" class="alignnone size-full wp-image-50281" /></p>
<p>Once you have the plugin&#8217;s zip file, go to the <strong>Plugins &raquo; Add New</strong> page in your WordPress admin area and click on the &#8216;Upload Plugin&#8217; button on the top. </p>
<p><img title="upload plugin" src="http://cdn.wpbeginner.com/wp-content/uploads/2018/02/uploadplugin.jpg" alt="upload plugin" width="550" height="238" class="alignnone size-full wp-image-50282" /></p>
<p>Next, click on the choose file button to select the zip file you created earlier and then click on the &#8216;Install Now&#8217; button. </p>
<p>WordPress will now upload and install the plugin for you. Once its uploaded, you need to click on the activate button to start using your site-specific plugin. </p>
<p><img title="Activate plugin" src="http://cdn4.wpbeginner.com/wp-content/uploads/2018/02/activateplugin.png" alt="Activate plugin" width="550" height="200" class="alignnone size-full wp-image-50283" /></p>
<p><strong>2. Upload Your Site-Specific WordPress Plugin via FTP</strong> </p>
<p>For this method, you don&#8217;t need to create a zip file. You will be <a href="http://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/" title="How to use FTP to upload files to WordPress for Beginners">uploading the plugin via FTP</a>. </p>
<p>First, you will need to connect to your website using a <a href="http://www.wpbeginner.com/showcase/6-best-ftp-clients-for-wordpress-users/" title="6 Best FTP Clients for Mac and Windows WordPress Users">FTP client</a>.  </p>
<p>Once connected, go to /wp-content/plugins/ folder under remote site column. Next, you need to select your site-specific plugin folder and upload it to your website. </p>
<p><img title="Uploading plugin via FTP" src="http://cdn2.wpbeginner.com/wp-content/uploads/2018/02/uploadplugin.png" alt="Uploading plugin via FTP" width="550" height="254" class="alignnone size-full wp-image-50284" /></p>
<p>Your FTP client will now transfer your site-specific plugin folder to your WordPress website. This will install the plugin on your website. </p>
<p>However, you&#8217;ll still need to activate the plugin to start using it. You can do this by going to the &#8216;Plugins&#8217; page inside your WordPress admin area and then click on the &#8216;Activate&#8217; link below your site-specific plugin. </p>
<p><img title="Activate plugin" src="http://cdn4.wpbeginner.com/wp-content/uploads/2018/02/activate-plugin.png" alt="Activate plugin" width="550" height="293" class="alignnone size-full wp-image-50285" /></p>
<p>That&#8217;s all. Your site-specific plugin is now ready to be used. </p>
<h4>Adding Custom Code Snippets to Your Site-Specific Plugin</h4>
<p>There are two ways to edit your plugin and add custom code snippets to it. </p>
<p>First method is to do it via WordPress admin area. You can go to <strong>Plugins &raquo; Editor</strong> page. You will see a warning message, and you need to click on &#8216;I understand&#8217; button to continue. </p>
<p>Next, you need to select your site-specific plugin from the drop down menu labeled &#8216;Select plugin to edit&#8217;. The editor will load your plugin file, and you will be able to add code snippets in it. </p>
<p><img title="Plugin editor" src="http://cdn3.wpbeginner.com/wp-content/uploads/2018/02/plugineditor.png" alt="Plugin editor" width="550" height="307" class="alignnone size-full wp-image-50286" /></p>
<p>Once you are done, click on the &#8216;Update File&#8217; button to save your changes. </p>
<p>If there is something missing in your code or it has potential to break your website, then the plugin editor will automatically undo your changes. </p>
<p>However, if the editor fails, and you see the <a href="http://www.wpbeginner.com/wp-tutorials/how-to-fix-the-wordpress-white-screen-of-death/" title="How to Fix the WordPress White Screen of Death">white screen of death</a>, then you can use FTP to edit your plugin file and undo those changes. </p>
<p>The second method is to directly edit the plugin file using FTP. Simply go to the plugin folder using your FTP client. Right click on the plugin file and then select View/Edit file. </p>
<p><img title="Editing plugin file via FTP" src="http://cdn4.wpbeginner.com/wp-content/uploads/2018/02/editpluginfile.png" alt="Editing plugin file via FTP" width="550" height="268" class="alignnone size-full wp-image-50287" /></p>
<p>You can also download the plugin file to your computer, edit it, and then upload it back. </p>
<h4>Method 2. Using The Code Snippets Plugin</h4>
<p>This method is a lot simpler and gives you a better way to manage your individual code snippets in WordPress. </p>
<p>First thing you need to do is install and activate the <a href="https://wordpress.org/plugins/code-snippets/"  title="Code Snippets" rel="nofollow">Code Snippets</a> plugin on your website. For more details, see our step by step guide on <a href="http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/" title="Step by Step Guide to Install a WordPress Plugin for Beginners">how to install a WordPress plugin</a>.</p>
<p>Upon activation, the plugin will add a new menu item labeled &#8220;Snippets&#8221; to your WordPress admin menu. This is where you will manage all your custom codes. </p>
<p>To add a custom code, you need to go to <strong>Snippets &raquo; All Snippets</strong> page and click on the &#8216;Add New&#8217; button at the top. </p>
<p><img title="Adding a new code snippet" src="http://cdn2.wpbeginner.com/wp-content/uploads/2018/02/snippets.png" alt="Adding a new code snippet" width="550" height="320" class="alignnone size-full wp-image-50319" /></p>
<p>This will bring you to the ‘Add New Snippet’ page.</p>
<p>First enter a title for your custom code snippet. This could be anything that helps you identify the code. </p>
<p>After that you can go ahead and paste your code snippet into the code box.</p>
<p><img title="Adding custom code" src="http://cdn.wpbeginner.com/wp-content/uploads/2018/02/addingcode.png" alt="Adding custom code" width="550" height="308" class="alignnone size-full wp-image-50320" /></p>
<p>You can also add a description for the code in the field below the code box. You should use this area to write down what this code does, where you found it, and why you are adding it to your website. This will help the &#8220;future you&#8221; remember why the &#8220;past you&#8221; added this code.</p>
<p><img title="Add your code description" src="http://cdn.wpbeginner.com/wp-content/uploads/2018/02/codedesc.png" alt="Add your code description" width="550" height="324" class="alignnone size-full wp-image-50321" /></p>
<p>You also have the option to assign tags to your code snippets which can help organize code snippets by topic and functionality.</p>
<p>Finally, you can click on the ‘Save Changes and Activate’ button. If you just want to save the code snippet without activating it, then you can click on save changes button instead. </p>
<p>The plugin also allows you to select where you want to run the code snippet. You can choose from admin area, front-end, or everywhere options. </p>
<p>If you are unsure, then keep the default &#8216;everywhere&#8217; option checked. </p>
<p>Once you have saved and activated a code snippet, it would become effective on your website. </p>
<p>For more details see our guide on how to <a href="http://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/" title="How to Easily Add Custom Code in WordPress (without Breaking Your Site)">easily add custom code snippets</a> in WordPress. </p>
<p>We hope this article helped you learn why and how to create a site-specific WordPress plugin. You may also want to see our list of <a href="http://www.wpbeginner.com/wp-tutorials/25-extremely-useful-tricks-for-the-wordpress-functions-file/" title="32 Extremely Useful Tricks for the WordPress Functions File">useful functions file tips</a> and <a href="http://www.wpbeginner.com/wp-tutorials/55-most-wanted-wordpress-tips-tricks-and-hacks/" title="55+ Most Wanted WordPress Tips, Tricks, and Hacks">most wanted WordPress hacks</a> to best use your site-specific plugin.</p>
<p>If you liked this article, then please subscribe to our <a href="http://youtube.com/wpbeginner?sub_confirmation=1" title="WPBeginner on YouTube"  rel="nofollow">YouTube Channel</a> for WordPress video tutorials. You can also find us on <a href="http://twitter.com/wpbeginner" title="WPBeginner on Twitter"  rel="nofollow">Twitter</a> and <a href="https://www.facebook.com/wpbeginner" title="WPBeginner on Facebook"  rel="nofollow">Facebook</a>. </p>
<p>The post <a rel="nofollow" href="http://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/">What, Why, and How-To&#8217;s of Creating a Site-Specific WordPress Plugin</a> appeared first on <a rel="nofollow" href="http://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwife.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="0" type="" />
		</item>
	</channel>
</rss>
