solve wordpress content directory plugin install

How to Fix Unable to Locate WordPress Content Directory (wp-content)

Fathi Arfaoui Plugin Problems Leave a Comment

If you’re moving your WordPress blog to another web hosting provider, you may find some errors when installing plugins or updating your existing plugins. The most popular error message will look like the following message.

Unable to locate WordPress Content directory(wp-content).

Or, in other cases, depending on your WordPress version and settings, it can look like the following one.

Unable to create directory wp-content/uploads

These errors related to the WordPress content directory are caused by the parameters in the server, especially, in the of the Linux operating system. But, we will fix this problem together, this tutorial is for beginner bloggers who started their WordPress blog, and who are not familiar with editing files directly in the control panel, of their web hosting accounts.

The error message will look like this:

Unable to locate wordpress content directory (wp-content)

Or in the latest version of WordPress, the error message will look a little different but with the same issue.

WordPress Content Directory error

At the same time, you can’t upload plugins, and WordPress shows an option to use your FTP client to upload files. So, to solve this problem we need to set up the auto update function, directly in the ”wp-config.php” file in the home directory

Steps to fix the wp-content directory problem

Find FTP username and details in the web hosting account

You should know your FTP username and password to use them later, generally, you can find more than one FTP user and here is the problem. But, only one user will work and make the WordPress update working again. So, login to your cPanel account and click on ”FTP Accounts” icons as the following screenshot.

Find FTP logins

Then, forget all the FTP account, and focus on one account only. You have to find the one with the person’s icon as below.

using FTP in cPanel

That’s is your default FTP account that will work with WordPress, when changing hosting. Just find it and then click on ”Configure FTP Clients” at the right. You will get the details of your FTP account username and the server (host).

Your password is the same as your cPanel login. Save your login details and move to the next step.

Edit the wp-config.php file in cPanel

To get started, you have to log into the cPanel, and click on ”File Manager”, or, ”Legacy File Manager”, both will work. You need to open all files in the ”web root” directory, such as the next screenshot.

Find File manager in cPanel

On modern cPanel, you’ll get a page with all your websites’ files, so, you can click the exact domain files you want. However, if you’re using old cPanel versions, you’ll get a popup window, click on ”Web Root Directory”, and check the ”Show Hidden Files”, as the following example.

show all hidden files in home directory

On the next page that will be opened in a new window, locate the file ”wp-config.php”.

how find the wp-confing.php file

To edit the ”wp-config.php” file, you need to select it first, then, you can click the ”Edit” option at the top of the page. Follow the next screenshot example.

Editing the ''wp-config.php'' file

Now, you just need to add the following code anywhere in that file that you’ve opened and change the details with your own.

define( 'FTP_USER', 'userhere' );
define( 'FTP_PASS', 'passwordhere' );
define( 'FTP_HOST', 'ftphosthere' );

”FTP server” is the same as ”FTP host”.

Of course, you need to replace the username, password, and host with yours.

Then, click the ”save changes” button at the top right corner of the page. Now, come back to your WordPress dashboard and update plugins, WordPress core, or do what you want, it should work now.

You can also use an FTP client like Filezilla. It allows you to edit your site directories and find any file. At the same time, you can easily change permissions or anything else.

If for any reason, you still get an error, and you can’t solve it, then, make sure to contact your web hosting provider, for more details and information with their server settings. They will solve the issue, it happens sometimes that the server settings and add-ons cause this problem. Or simply, change to a premium and professional hosting like InMotion Hosting that I recommend, and forget all the problems.

An expert technician will manage your site and the server, and you can focus on your content, instead of wasting the time with settings and fixing settings. Best of all, they are the fastest WordPress hosting and nothing is better than a blazing fast loading time. It helps ranking better in Google and to offer a better user experience.

I’m a WordPress expert with over 6 years of experience in solving problems with themes, plugins, code, and structure. Let e help you fix your blog or website issues through tutorials or contact me directly.

Leave a Reply

Your email address will not be published. Required fields are marked *