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.

5 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?

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