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
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 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):
- /* That's all, stop editing! Happy blogging. */
- /** WordPress absolute path to the WordPress directory. */
- if ( !defined('ABSPATH') )
- /** Sets up WordPress vars and included files. */
- require_once(ABSPATH . 'wp-settings.php');
Now right after the last line, add this:
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!