WordPress Configuration Tricks

admin » 01 July 2009 » In Wordpress SEO »

Moving Your wp-content directory

As of WordPress version 2.6, you may change the default location of the wp-content directory. There are several good reasons for doing this, including enhancement of site security and facilitation of FTP updates. Here are some examples:

// full local path of current directory (no trailing slash)
 
define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'].'/path/wp-content');
 
// full URI of current directory (no trailing slash)
 
define('WP_CONTENT_URL', 'http://domain.tld/path/wp-content');

You may also further specify a custom path for your wp-content directory. This may help with compatibility issues with certain plugins:

// full local path of current directory (no trailing slash)
 
define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'].'/path/wp-content/plugins');
 
// full URI of current directory (no trailing slash)
 
define('WP_PLUGIN_URL', 'http://domain.tld/path/wp-content/plugins');

via WordPress Configuration Tricks.

Trackback URL

Comments are closed.