Rename wp-content Folder & Hide wp-admin Login Path

WordPress is the world’s biggest content management system, it is home to more than 75 million websites. All the themes uploaded, images, plugins are stored in the wp-content folder, the images’ URL contains wp-content which makes it easier for anyone to know you are using WordPress. WordPress is vulnerable when it comes to attacks, so changing the name or hiding the admin login path gives you some security against these cyber attacks.

Renaming the wp-content folder is an easy task, you just need to add a few lines of codes. But before that you must consider the following:

  1. Renaming the wp-content folder may lead to a few minutes of downtime.
  2. All the themes will be deactivated and you need to activate them manually.
  3. Some plugins may not work as properly as they were working before.

Rename wp-content Folder :

Step1: Login to FTP client
  • Login to your website using any FTP client, go to the root directory, and rename the wp-content folder.
  • You can rename it to anything, make sure not to use spaces or characters.
Step 2: Telling WordPress you have changed name
  • After changing the name you have to tell wordpress, the new name of the wp-content folder.
  • Open wp-config file in the root directory, and above require_once(ABSPATH . ‘wp-settings.php’);  this line, paste:

 define (‘WP_CONTENT_FOLDERNAME’, ‘Folder_Name’);

Step 3:  Define new directory path
  • After this, you have to define a new directory path and URL.
  • To do that above require_once(ABSPATH . ‘wp-settings.php’) this line of code, add:

//Define new directory path

define (‘WP_CONTENT_DIR’, ABSPATH . WP_CONTENT_FOLDERNAME);

//Define new directory URL

define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/’);

define(‘WP_CONTENT_URL’, WP_SITEURL . WP_CONTENT_FOLDERNAME);

Save this file and upload it again to the server.

After these 3 simple steps the WordPress wp-content folder name is now changed, plugins may be deactivated and you have to activate them manually.

Hide wp-admin login path:

You can easily hide the wp-admin login path.

  • Step 1: Log in to your WordPress site using the admin panel
  • Step 2: Go to Dashboard >> Plugins >> Add new, search for WPS hide login.
Rename wp-content Folder

Step 3 : Install and activate the plugin.

Step 4: Go to settings >> WPS hide, and here you can change or update the login URL.

Share This Post...
Table of Contents

Add a Comment

Share This Post...