Unable to Locate WordPress Content Directory wp-content

Unable to Locate WordPress Content Directory wp-content

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.

Related Posts

Leave a Reply

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