Moving wpcontent

You can move your wp-content folder elsewhere if you like or rename it to something else. However, there are a number of constants related to the wp-content and plugins directories. To make sure your plugins continue working correctly, you should define all of these constants in your wp-config.php file. Add the constant definitions anywhere in the configuration file, as shown in Listing 11-4.

Listing 11-4. Renaming /wp-content to /files define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/files'); define('WP_CONTENT_URL', 'http://example.com/files'); define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/files/plugins'); define('WP_PLUGIN_URL', 'http://example.com/files/plugins'); define('PLUGINDIR', $_SERVER['DOCUMENT_ROOT'] . '/files/plugins');

Once you've made these changes, you also need to change the location of your uploads directory. You might recall seeing this setting in Chapter 3. Go to Settings Media and change the paths as shown in Figure 11-13.

Figure 11-13. Changing the upload paths in Settings Media
0 0

Post a comment