Unable to Locate WordPress Content Directory wp-content
19 Feb
I encountered this problem when attempting to upgrade my version WordPress (for this blog) and also upgrade my WordPress plugins to the newest versions.
I chose to upgrade my WordPress blog automatically, entered the correct ftp details and came across this error:
Unable to Locate WordPress Content Directory wp-content
I racked my brains for a while making sure that all the permissions to the necessary files were correct and after about 45 minutes I found a blog post by Hui Wang which provided the answer.
The problem may not necessarily be with WordPress or any of my files / permissions but actually my hosting company. My blog is currently hosted through byethost.com and quite a few people who have WordPress blogs get the same problem.
To fix the problem, add the following code to the bottom of your wp-config.php file:
/** Override default file system method*/ if(is_admin()) { add_filter(‘filesystem_method’, create_function(‘$a’, ‘return “direct”;’ )); define( ‘FS_CHMOD_DIR’, 0751 ); }The above code overides the default file system method to allow WordPress to upgrade, delete plugins directly (without using ftp details). It works for me and saves me from having to download .zip files and uploading them through my ftp client etc… which takes up a lot of time when you have a lot of plugins.
Let me know if it works for you or if you have any other problems or solutions let me know and I’ll write a post about it.

Keep posting stuff like this i really like it
Thanks for this post, very helpful!
Found that on the original blog (which was from yet another blog) and tried it; it didn’t work.
It gave me a new error:
Downloading install package from http://wordpress.org/extend/themes/download/lunatic-fringe.1.4.zip…
Unpacking the package…
Could not create directory. /home/[sitename]/public_html/blogtest/wp-content/upgrade
Hi Tina,
What version of WordPress are you running? I haven’t tested this fix for WordPress 3.0 (haven’t upgraded myself yet).
I’m guessing all your permissions are set up correctly?
Its happened with me too, Its actually byte host’s problem they have different hosting structure then others, instead of public_html they use htdocs folder, so it is root cause for this.
Hi Richard,
I’m having the same problem as you did with WordPress and byethost.com the only difference I can see is that I’ve downloaded WP 3.0.5
I moved DNS of my domain name to byethost.com and then filezilla’d the unzipped folder. I had changed the original file to include the ftp info and when that didn’t work I searched more and found your post. I tagged your code onto the end as you explained, but still no luck. Did you manage to help Tina who commented earlier?
Many thanks in advance,
Matt
Hi Matt,
Tina never got back to me but I will be happy to pick up the cause again for you.
I have just had a quick check, I think the work-around mentioned in my post doesn’t work for WordPress version 3.0+ (haven’t tested this properly). Will have a look tonight and will try to find an answer.
Like your domain name by the way: yeebaa.com
Hi guys.
I have a kind of a problem with byethost free and wordpress in addon domain configuration. If I install wordpress on sub folder mydomain.com on bayethost and try to get ftp working from the back end of wordpress I get an error. Byethost free gives only one pre configured ftp account and that connects to root htdocks, not to my subdomain. How to fix that. I can not add any content through wordpress back end :S Only with ftp client, manually. That sucks! Is there a workaround, or its pay sucker cenario?
Tnx.
Hi Nicholas,
The above fix works for earlier versions of WordPress but i doesn’t work for versions 3.0+. I haven’t been able to find a fix that applies to the latest versions of WordPress. The problem is with Byethost and where the root folder is (I haven’t looked at this in a while and my memory is a bit hazey).
Sorry I couldn’t be much more help, I have had a couple of friends upgrade to shared hosting with Byethost and they haven’t given it great reviews (one said the free hosting was better). If you’re looking for something decent, cheap(ish) and works with WordPress, I would suggest Fat Cow, they’re alright.
Hi Richard,
I had the same problem running WP 3.2.1 today. I am part of a hosting company, and the problem occurred on a Linux server running Plesk. We were unable to determine anything we could do on the server side to correct it. We do not have this issue on our non-Plesk boxes.
Your fix worked perfectly.
Thank you VERY much!