WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got this error message when I was installing a plugin: "Unable to locate WordPress Content directory (wp-content)".

I found a solution here: http://wordpress.org/support/topic/cannot-find-content-directory-wp-content

They suggested adding the following code to the wp-config.php file:

if(is_admin()) {
    add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
    define( 'FS_CHMOD_DIR', 0751 );

This solution worked for me. My questions are:

a) What does this code do?

b) If I run into the same error on the production server is it safe to use this code?

Thank you.


share|improve this question
up vote 2 down vote accepted

The first part (add_filter()) tells WordPress to use the direct-write method. The second part (define()) tells WordPress to apply 0751 permissions to any directory it creates. More information here.

I would not consider using the Direct Write method to be safe to use in a live, public, shared-hosting environment.

Also, it might not - and in fact probably won't - work in a shared-hosting environment.

share|improve this answer
Hi Chip, Thank you for the help. I guess I'll use it on my local machine (Mac running WP 3.1.2) and not use it on the production server. – Laxmidi May 3 '11 at 21:34

I agree this is a bad idea.Though the permission itself might not be an issue the method is.

751 is a file system permissions (chmod), it means:

User: read/write/execute
Group: read/execute
All: execute

share|improve this answer
Hi Wyck, Thank you for the message. – Laxmidi May 3 '11 at 21:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.