How to Change Wp-content Folder Name in WordPress

How to Change Wp-content Folder Name in WordPress Featured Image

In WordPress all your themes, plugins, and uploaded images are stored in the “wp-content” folder. In fact, the URLs of images, stylesheets, etc., contain the folder name “wp-content” in them, which makes it easy for anyone to know you are using WordPress. If you think the default folder name is not intuitive or if you would like to customize the name to meet your personal taste, you can easily rename the folder. Here’s how to do it.

Also read: 8 Common HTTP Errors and How to Fix Them

Things to Know Beforehand

Changing or renaming the “wp-content” folder is easy. All you have to do is add a few lines of code. However, there are some things you should consider before renaming the folder.

  • If your website or blog is already live and serving content, be prepared for at least a couple minutes of downtime.
  • Renaming the “wp-content” folder doesn’t necessarily improve security or hide the fact that you are using WordPress.
  • All the installed plugins and themes will be deactivated in the process. You have to manually activate them after renaming the folder.
  • Sometimes deactivated themes may lose their settings. Back up settings before proceeding.
  • After renaming the folder, some plugins may not work as they should. The reason being is that the offending plugins may not be following the WordPress guidelines and have a hardcoded “wp-content” folder name.
  • On an established site or blog the old URLs are not automatically redirected to the new URL. You have to manually do that using plugins like Redirection, so I recommend you think twice before making this change on a live site.

Also read: How to Set Up WordPress Using Docker in Ubuntu

Rename the “wp-content” Folder

Note: When doing changes to a live WordPress site, create a full backup. If anything goes wrong or the result is not desirable, you can restore the site to its known good state.

First, open your favorite FTP client, log into your site and rename the “wp-content” folder located in the root directory. In my case I renamed it to “content.” You can rename it anything you want like assets, resources, core, files, etc. Just make sure that you are not using any spaces or other obscure characters.

As soon as you rename this folder, the backend Plugins page will show errors and the front end breaks, too.

rename-wp-content-folder-plugin-errors

To fix that we need to tell WordPress that we have changed the folder name.

Open the “wp-config.php” file in the root folder. Add the below code snippet above the require_once(ABSPATH . 'wp-settings.php'); line. Don’t forget to replace “Folder_Name” with the actual folder name.

//Rename wp-content folder
define ('WP_CONTENT_FOLDERNAME', 'Folder_Name');

This is how it looks once you add it.

rename-wp-content-folder-add-first-code-block

After that we need to define the new directory path and URL. To do that, add the below code above the require_once(ABSPATH . 'wp-settings.php'); line.

//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);

rename-wp-content-folder-add-second-code-block

Save the file and upload it to your server.

Once you’ve done that, your site should be up and running without any errors. Like I said before, all your plugins and themes will be deactivated. You have to activate them manually. If needed, you might also have to re-configure the plugins, themes, and widgets.

Comment below sharing your thoughts and experiences regarding using the above method to rename the “wp-content” folder.

Also read: How to Get a Free SSL Certificate for Your WordPress Website

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Vamsi Krishna Avatar

Read next

Suzanne Simard sealed paper birch and Douglas fir seedlings inside plastic bags, fed them carbon-14 and carbon-13 dioxide, and nine days later found carbon had crossed between species through fungal threads in the British Columbia soil beneath her boots
A species of jellyfish called Turritopsis dohrnii can revert its adult cells back to a juvenile polyp stage when injured or starving, effectively restarting its life cycle, and biologists have so far failed to identify any natural limit to how many times it can do this.
A Japanese man named Jiroemon Kimura, who lived to 116, was born in 1897 when Queen Victoria still ruled and died in 2013, meaning a single human life personally overlapped with the invention of the airplane, the atomic bomb, the internet, and Instagram
The Hollywood sign originally read HOLLYWOODLAND when it was built in 1923 as a real estate advertisement for a housing development, and it was only meant to stand for 18 months, but nobody ever got around to taking it down and the city eventually adopted it as a landmark
Almost all of the world’s internet traffic does not travel by satellite but through fibre-optic cables lying on the ocean floor, a hidden web of wires crossing the deepest parts of the sea to connect the continents.
People who flip their phone face down on every table aren’t being secretive. They figured out that staying interruptible meant handing their time to whoever rang first
Twitch vs. Facebook Gaming vs. YouTube Gaming: What’s the Best Live Game Streaming Platform?
Chrome Extensions Ownership Transfer is a Direct Threat to You: How to Stay Safe