yanknudtskov
1/4/2014 - 1:19 PM

Move the WordPress Plugin Directory So far we have assumed your plugin directory will be staying inside the content directory, but it doesn

Move the WordPress Plugin Directory

So far we have assumed your plugin directory will be staying inside the content directory, but it doesn’t have to. To ensure maximum compatibility with properly coded plugins, be sure to set both the WP_PLUGIN_DIR and WP_PLUGIN_URL constant. WP_PLUGIN_DIR is the path relative to wp-config’s location and WP_PLUGIN_URL is the full URL, http:// and all, of the directory’s location. You can either hardcode your site’s address, or use $_SERVER['HTTP_HOST'] to set it programatically.

define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/path/to/plugins' );
define( 'WP_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/plugins' );