Guide: Solving WordPress Update Issue – “Unable To Locate WordPress Plugin Directory”

No cats are harmed in the making of this post. I swear!
Ever since WordPress introduced automatic updates in the engine, I have been very excited, as now I don’t have to cringe at every thought of uploading, checking every file is good, and spend a lot of time in the sandbox before finally updating my WordPress installation.
However, depending on your server setup, this automatic updates feature might work beautifully, might not work fully, or might not work at all. Typically, there’s two behavior of the feature:
- First – it will automatically update your plugins and wordpress installation if wordpress have all the rights, and able to locate where the files are.
- Second – sometimes it will ask you for your ftp login and password, and will update your plugins and wordpress installation from there
The Problem
By right, this should solve all possible issues pertaining file permissions and location. However, I do not know what’s wrong with my hosting setup, but wordpress will issue me either of these messages upon providing my FTP username and password:
- Unable To Locate WordPress Plugin Directory
- Unable To Locate WordPress Content Directory (wp-content)
Irritated, I quickly seek solutions, and I stumble upon Aleksey’s post on this blog on how he manage to solve this issue on his end. I tried this solution and somehow it doesn’t work. WordPress issued me the second error message (see above). It keeps on telling me that it is unable to locate the wp-content directory even though it is obviously there!
So after various searches, I finally found the solution that works for me.
The Solution
The solution is very simple (the one that worked for me). All you need to do is to edit your wp-config.php.
First, open your wp-config.php file and look for this section (usually towards the end of the file):
69 70 71 72 73 74 75 76 | /* That's all, stop editing! Happy blogging. */ /** WordPress absolute path to the Wordpress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); /** Sets up WordPress vars and included files. */ require_once(ABSPATH . 'wp-settings.php'); |
Now right after the last line, add this:
78 79 80 81 | if(is_admin()) { add_filter('filesystem_method', create_function('$a', 'return "direct";' )); define( 'FS_CHMOD_DIR', 0751 ); } |
So your edited wp-config.php codes should now look like this:
69 70 71 72 73 74 75 76 77 78 79 80 81 | /* That's all, stop editing! Happy blogging. */ /** WordPress absolute path to the Wordpress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); /** Sets up WordPress vars and included files. */ require_once(ABSPATH . 'wp-settings.php'); if(is_admin()) { add_filter('filesystem_method', create_function('$a', 'return "direct";' )); define( 'FS_CHMOD_DIR', 0751 ); } |
That’s all, save the file, upload (obviously), and try to update your plugins this time. It shouldn’t even ask for any FTP access. It would just update it automatically!
[source]









thank you very much.one of headache with this……
No problem :) Glad it helped!
Where is the file wp-config.php. stored in? I can't find it.
It's on the root of your wordpress install folder. You need to FTP into your server to get that file :)
Perfect! This is the best solution for this problem so far. Thanks a lot!
Great job!!
Brilliant – many thanks indeed :-)
Hi, I used your tip and progressed further, but then it tells me:
Downloading install package from http://wordpress.org/extend/themes/download/lunat…
Unpacking the package…
Could not create directory. /home/(site)/public_html/blogtest/wp-content/upgrade
I dumb question – but I dare to ask it: where do I find the wp-config.php file?
Thanks for posting this fix. Works great!
thank you for this! it really solved my problem! ^^
thank you
for some reason my site wouldnt load at all after doing that, i just got a plain white screen, but maybee im doing something else wrong
THANKS. so frickin happy it worked, spent 5 frecking hours trying to figure that one out…jesus
You're welcome! I spend a while figuring this out as well, I'm glad this helped :D
Maybe you wanna check if you left out some semicolons?
Useful Stuff… » Solving Wordpress Update Issue – “Unable To Locate Wordpress Plugin Directory” says:
[...] via Guide: Solving WordPress Update Issue – “Unable To Locate WordPress Plugin Directory” – fird… [...]
I got the same issue
for me this is not working, even changet dhe plugin and update to 777, and still nothing …
wordpress 3.03
Same here, setting the whole wp-content and subdirectories to 777 doesn't help at all, still getting access denied
You are awesome!! Thank you!
awesome. this finally solved this.
At last!
This issue has been bugging me for weeks – thank you Ross, thank you ! !
Cheers, Mark
You're welcome! Glad it helps!
Hm I'm not sure why. But it could be some limitations on some web hosting provider though.
This worked for me in addition to using 775 folder permissions.
SIMPLISM.KR » Blog Archive » [WP/Customize] 테마 및 플러그인 설치를 보다 편리하게 - Simple is the Best! says:
[...] http://www.firdouss.com/2009/10/guide-solving-wordpress-update-issue-unable-to-locate-wordpress-plug... [...]
I think you’re better off using the official WordPress constants to fix this problem. See the documentation here:
http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants
These two lines fixed the problem for me, but you can try some of the other settings to see if they help you:
define(‘FS_METHOD’, ‘ftpsockets’);
define(‘FTP_BASE’, ‘/public/www/’);
WordPress, IIS and Plesk “Unable to find wp-content” Woes and Solution « Weblog Tools Collection says:
[...] that adding a few lines of code to the end of your wp-config.php can solve most issues. As from Firdouss.com guide, try this solution first. Open up your production wp-config.php, find the end of the file and add [...]