You can relocate the wp-content folder by defining these constants in wp-config.php before the require_once line that loads wp-settings.php:
define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . '/your-folder-name' );
define( 'WP_CONTENT_URL', 'https://yourdomain.com/your-folder-name' );What each constant does:
WP_CONTENT_DIR– the absolute server path to the new folder (used for file system operations)WP_CONTENT_URL– the absolute server path to the new folder (used for file system operations)
Checklist before switching:
- Physically move the
wp-contentfolder to the new location on the server - Add the constants to
wp-config.phpbeforewp-settings.phpis loaded - Update any hardcoded URLs in the database (use WP-CLI’s
search-replaceor a plugin like Better Search Replace) - Check your
.htaccess— rewrite rules referencingwp-contentdirectly may need updating - Test that themes, plugins, and media all load correctly
