Fix Automatic Plugin Update

February 07th, 2009 – 44 Comments

I recently moved from a MediaTemple Grid Server to a MediaTemple DV extreme, and in that move, I lost the ability to do automatic plugin updates, and it instead required me to enter my FTP info.

As I use a gigantic amount of plugins, that becomes annoying very soon. So I decided to find out what the issue is. Turns out that I’m having the same issue as the guy who filed this bug was. Filesystem access is available, the files are owned by me, but the webserver doesn’t run as me, and thus, WordPress doesn’t detect the automatic update correcly.

There’s a patch in there that makes it work, but might cause issues for some other users. Luckily, DD32 proposed a solution in the last comment: a plugin that makes sure “direct” is returned as the filesystem_method.

So until this issue is fixed in WordPress core, you can download and install this plugin. After which, you can auto update all your other plugins with ease, as long as filesystem access is available.

Please note: I give no guarantees here, and please, if you don’t get this to work, disable the plugin and call your host, not me. There’s two few things you need to check:

  1. Make sure the wp-content/plugins/ directory and all the files in it are writable for the webserver.
  2. Make sure the wp-content/upgrade/ directory exists, and is writable by the webserver.

Update: I ended up switching hosts over issues like this one. More info on my WordPress hosting experiences here.

Update #2: Putting this in your wp-config.php will help in most cases without needing the plugin:

define(‘FS_METHOD’, ‘direct’);

44 Responses to Fix Automatic Plugin Update

  1. Guib
    By Guib on 30 November, 2009

    Many thanks fot that plugin who saved me a lot of time since I moved to another server !

  2. Luke
    By Luke on 27 July, 2009

    That worked a treat. Thanks!

  3. Peter Olle
    By Peter Olle on 20 July, 2009

    Maybe not in time to solve your problem Joost, but for everyone with the automatic plugin update FTP problem in mediatemple or other host, just add the data to your config file in wordpress.

    define('FTP_HOST', 'localhost');
    define('FTP_USER', 'user');
    define('FTP_PASS', 'pass');

    With that everything will work smoothly. Hope it helps.

    • Rarst
      By Rarst on 20 July, 2009

      Thank you, tried this just now with WP 2.8.2 upgrade and it worked perfectly. Only had to add password line, WP remembers host and login for upgrades.

  4. Beau
    By Beau on 11 June, 2009

    Thanks so much! I’d been beating my head against the wall trying to figure this out for weeks. This worked like a charm. Much appreciated.

  5. Jonah Korbes
    By Jonah Korbes on 29 May, 2009

    Works perfectly for WPMU. Thanks very much.

  6. Alex
    By Alex on 19 February, 2009

    Thank for this fine plugin (and Tweetbacks, too!)!

    If you enhance the plugin with automatic update of the core and themes, this would be great. I have tested WP 2.7.1 with Autoupdate (both, FTP, too), but it doesn’t work, i tried changing the permissions, tried to place it under the WWW-Root, maybe WP doesn’t like FTP Server like “”. PS: The Upgrade-Dir in wp-content is writeable.

  7. KimC
    By KimC on 15 February, 2009

    My mistake – that’s good to know. I searched by author name and only found one…maybe your name is listed differently on different plugins…

  8. KimC
    By KimC on 13 February, 2009

    I watched your seo video and love what you do with your plugins – but why aren’t most of them available at Wouldn’t this make auto updates a no-brainer and give you, the author, instant street credit?

    • Joost de Valk
      By Joost de Valk on 15 February, 2009

      Hey Kim, 95% of my plugins actually ARE on, that’s why I’m among the 10 plugin authors with the most plugin downloads :)

  9. Milad
    By Milad on 12 February, 2009

    wow! works like it is tamed to!
    big thanks man…
    if u ever come to Iran, call me and i’ll treat u some good food!

  10. Gustavo Leig
    By Gustavo Leig on 11 February, 2009


    can I ask you why you decided to move to a dv? more capacity or just the gs problems (Im now with a gs)? Did you get better perfomance after moving? Also, if you have any tip on moving from a gs to a dv, this should be a goog article in future.


    thanks for the tip.

    • Chris Coyier
      By Chris Coyier on 11 February, 2009

      So the 2.7.1 upgrade is out, and it looks like if this plugin thing is an issue for you, this automatic upgrade is going to be too. Can the plugins ideas be expanded to allow for this as well?

      • Joost de Valk
        By Joost de Valk on 15 February, 2009

        Hi Chris, just make sure the whole wordpress directory is writable by the webserver, and this’ll work as well!

    • Joost de Valk
      By Joost de Valk on 11 February, 2009

      I needed more performance, the performance increase was huge. On the move itself: that was done for me by MT’s managed care team, so can’t really write an article about that ;)

  11. Chris Abernethy
    By Chris Abernethy on 11 February, 2009

    Joost, I recently posted an article on this same issue with a few more details on the specifics of why it occurs: In my case, I was having the problem on one of my local, firewalled development servers, so the easy fix was to chown -R apache: the WordPress installation. Your situation is a bit more difficult, as it doesn’t sound likely that you can change the ownership of plugin-install.php to the system user running apache.

  12. Neil
    By Neil on 9 February, 2009

    I was using the automatic upgrade plugin on a free hosting service and it always required my FTP login details. After switching to a paid host it begun to work correctly.

    I was wondering what was causing the problem but this has helped to clarify things.

  13. Bart
    By Bart on 9 February, 2009

    Just to be sure…
    You mention:
    “Make sure the wp-content/plugins/ directory and all the files in it are writable for the webserver. Make sure the wp-content/upgrade/ directory exists, and is writable by the webserver. ”

    What attributes should you have on the plugin and upgrade folder? 775, 777 or something different?
    Should you apply this for al the subfolders also?

    • Nicolas
      By Nicolas on 11 February, 2009

      I was curious too. I’m having all sorts of issues with upgrading the plugins and such.

  14. Chris Coyier
    By Chris Coyier on 8 February, 2009

    This is huge. I too am on (dv) and cannot auto-upgrade plugins. I have this installed now, but don’t have any plugins out of date. As soon as one comes up I’ll test it and let you know.

    I’m having some other weirdnesses since switching to (dv) as well.

    1) Posts don’t auto-save as a write them like the used to.
    2) I can’t schedule posts to be published later. The time will come and go and the post will then say “Missed Schedule” instead of just publishing.


    • Charles Simmons
      By Charles Simmons on 10 February, 2009

      @ Chris Coyier

      The posts scheduling issue is usually related to wp-cron.php. Open your /etc/hosts file and make sure that the IP address listed is yours.

  15. da shaikh
    By da shaikh on 8 February, 2009

    its mind blowing mannn….
    i was very much concerned about my websites and which is about to launch.
    your plugins have really called my hearts and inspire me towards your works….

  16. Kevin Boss
    By Kevin Boss on 8 February, 2009

    Yeah same outcome as Rarst.

  17. Ricky C
    By Ricky C on 8 February, 2009

    I just check all your plugin, they are all worth to try, Good Job! I’m looking forward for your next updates

  18. Rarst
    By Rarst on 8 February, 2009

    I didn’t even know it is possible in other than FTP way. :) However solution didn’t work for me – I had to change bunch of permissions but in the end upgrade nuked old version of plugin and failed to install new one. My host I guess, back to FTP way.

    • Joost de Valk
      By Joost de Valk on 8 February, 2009

      So it was able to delete the old directory? Did it have write access to the wp-content/plugins dir itself? Perhaps it couldn’t create the new dir for the new plugin.

      • Rarst
        By Rarst on 8 February, 2009

        There were different errors as I started with permissions for wp-content and moved down, retrying upgrade after each permission modification. It was able to kill old version in the end, I think it should have had enough rights to create folder because I started changing permissions from top so wp-content was 775 by then.

  19. DD32
    By DD32 on 8 February, 2009

    Just like to make it clear: This is not a bug.

    If the files are owned by a user other than the webserver, Then under most web server setups, Having the webserver modify the files, can cause issues, Mainly, The user being unable to delete any files the webserver touches from your home directory.

    The reason that the error “cannot remove old plugin” comes up, Is exactly due the the above, If the webserver cannot modify the files (Which it shouldnt be able to if they’re not owned by the webserver), Then its going to be unable to delete them, IF you install a new plugin, then instead of the Webserver not being able to delete it, YOU will not be able to delete it.

    So its NOT A bug, Mearly making it work nicely for Everyone. If It cannot modify the filesystem directly, It reverts to using FTP. If you have the PHP SSH extension installed, You can upgrade via SSH2 instead of FTP if you wish.

  20. Jim
    By Jim on 7 February, 2009

    I upgrade from a (dv) Rage to a (dv) Extreme recently, but I’ve been on MediaTemple since last summer, and the auto update has always asked for my FTP credentials. I tried using this plugin to rectify the problem, but it just comes back with the ‘cannot remove old plugin’. Any idea why that might be and what I’d have to do to fix it?

  21. Chris in Cincinnati
    By Chris in Cincinnati on 7 February, 2009

    Outstanding. I just upgraded from (gs) to (dv) as well and was wondering what was up with this.


  22. Austin
    By Austin on 7 February, 2009

    Awesome plugin! I wish that there was a plugin that would allow sftp connections though :C I use SSH but not FTP.

  23. Kevin Boss
    By Kevin Boss on 7 February, 2009

    Wow this is exactly what I was looking for about 2 weeks ago – thanks!

  24. SeiferTim
    By SeiferTim on 7 February, 2009

    Thanks! This has been a thorn in my side since the feature was implemented! I hope this fixes it… :)

  25. Etherealmind
    By Etherealmind on 7 February, 2009

    I have been really unhappy with how long Mediatemple are taking to fix the storage problems on their GS product. It has been more than than six months of constant outages and service losses while they resolve various problems with their GS service.

    Since GS is a type of Cloud Computing, it is not inspiring. More importantly, will Mediatemple ever get their GS service to work?

  26. Chung Bey Luen
    By Chung Bey Luen on 7 February, 2009

    I didn’t notice WordPress has such issue. But I will take take note about the problem in future if I move my server. Thanks for sharing.

  27. Erik Reagan
    By Erik Reagan on 7 February, 2009

    Excellent! I’ve been on a DV setup for about 6 months and was never really motivated enough to hunt down the issue causing the auto upgrade problem. Thanks for the post and reference!

Check out our must read articles about Analytics