Skip to content

Instantly share code, notes, and snippets.

@tux255
Last active August 13, 2017 09:33
Show Gist options
  • Save tux255/878e682b1a47e329439e822b5c26fe0c to your computer and use it in GitHub Desktop.
Save tux255/878e682b1a47e329439e822b5c26fe0c to your computer and use it in GitHub Desktop.
Move your wp-content Directory

Starting from WordPress 2.6, you can move your wp-content directory. It helps with site security or cooiless domain in my case. You can do move your wp-content directory by adding the following code in your wp-config.php file.

P.S. We have the plugin directory defined because some plugins might not work if you do not define it specifically.

define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content' );
define( 'WP_CONTENT_URL', 'http://example/blog/wp-content');
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content/plugins' );
define( 'WP_PLUGIN_URL', 'http://example/blog/wp-content/plugins');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment