The wp-content folder contains your themes, plugins and uploads. Certain plugins, such as caching plugins, also use the wp-content folder to store data.

Due to this, the wp-content folder is frequently a target for hackers, particularly those that insert malware into your theme files. You can make it difficult for people to find your wp-content directory by moving it to another area of your website.

If you want to simply move the wp-content folder to another location, you can add this code to your wp-config.php file:

* Notice the wp-content folder does not have a trailing slash

define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/newlocation/wp-content' );

If you prefer, you can define the new location using the URL:

define( 'WP_CONTENT_URL', 'http://www.yourwebsite.com/newlocation/wp-content' );

WordPress also allows you to rename your wp-content folder using:

define ('WP_CONTENT_FOLDERNAME', 'newfoldername');

Renakming your wp-content folder can make WordPress website even safer, however it is unfortunately not always practical to do so because many WordPress plugin developers continue to hard code “wp-content” into their plugin code. It may still be worth doing if security is a top priority, though be aware that it may require you to manually update the code of many plugins you use (and these would have to be manually updated every time you updated the plugin).