Unable to Locate WordPress Content Directory wp-content

19 Feb

WordPress logo in greyI 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.

About the Author: Richard Havelock (9 Articles)

Web designer, developer and SEO expert based in Newcastle upon Tyne, UK. Richard has over 5 years experience as a web designer / developer and is currently head of SEO at ne-web Ltd. He is also the co-founder of successful NUFC Blog: Leazes Terrace. You can follow Richard on twitter: @websdevelopment

11 Responses to “Unable to Locate WordPress Content Directory wp-content”

  1. cna training 28. Feb, 2010 at 2:34 pm #

    Keep posting stuff like this i really like it

  2. Web Design Norwich 17. Jul, 2010 at 11:53 am #

    Thanks for this post, very helpful!

  3. tina 27. Jul, 2010 at 8:13 pm #

    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

  4. Web Developer Blog 28. Jul, 2010 at 6:35 pm #

    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?

  5. Web development canada 14. Feb, 2011 at 5:55 pm #

    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.

  6. Matt | Yeebaa 23. Feb, 2011 at 5:09 pm #

    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

  7. Web Developer 04. Mar, 2011 at 2:46 pm #

    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

  8. Nicholas 27. Apr, 2011 at 8:00 am #

    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.

  9. Richard Havelock 05. May, 2011 at 4:27 pm #

    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.

  10. Klaus Gebhardt 16. Sep, 2011 at 2:49 pm #

    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!

Trackbacks and Pingbacks

  1. uberVU - social comments - 28. Feb, 2010

    Social comments and analytics for this post…

    This post was mentioned on Twitter by websdevelopment: #wordpress – Unable to Locate WordPress Content Directory wp-content – http://b2l.me/gsym6 (via @websdevelopment)…

Leave a Reply