WP-cron not working?

So when I moved to the (DV) server at MediaTemple, it turns out that my WP-Cron stopped working. I didn’t notice for a while, until I found out that the new version of Tweetbacks didn’t work for me anymore, and this was using wp-cron.

The fix turned out to be very simple, after some debugging with the help of Donncha: in my /etc/hosts file, pointed not only to localhost, but also to yoast.com, and when you opened, you didn’t get yoast.com. So I removed yoast.com from that line, and restarted apache, and tadaa! wp-cron started working again.

This might also cause issues for other people, which is why I post about it. It might, for instance, explain why people are having issues with the WP-Super-Cache garbage collection not working.

Let me know in the comments if this helps you, or whether you had to do other things to get it working!

Update: I ended up switching hosts over issues like this one. I’m now on WestHost, and all seems to be good. More info on my WordPress hosting experiences here.

23 Responses

  1. Chung Bey Luen
    By Chung Bey Luen on 19 February, 2009

    I have a related post on WordPress missed schedule on my blog.

  2. Peter
    By Peter on 19 February, 2009

    Just know that by removing yoast.com from the /etc/hosts could in theory disrupt other services that depend on name resolving and ip security.
    Accessing your MySQL for example. MySQL could do name resolving and block your external IP (I assume yoast.com resolves to an external IP right now) access to the tables.

    What did you get when opened in Apache?

  3. Paw
    By Paw on 19 February, 2009

    Amazing blog you have here on yoast.com, i like your writing style! I have addet your feed to my rss reader.. I will look forward to the next post.


  4. Dave Ward
    By Dave Ward on 19 February, 2009

    Watch out, because that /etc/hosts line gets regenerated every time your (dv) restarts. There’s a thread about it on the (mt) forums (in the (dv) section).

  5. brad hart
    By brad hart on 19 February, 2009

    I noticed this had quit working too. I wouldn’t even no where to start editing the file you mention so thanks for mentioning this. I have reverted to the pre-cron version which worked just fine for me, I think you will have a lot of people people in this same boat. Other than this upgrade change this has been a fabulous plugin so safe.

  6. Donncha O Caoimh
    By Donncha O Caoimh on 20 February, 2009

    It reverts the hosts file? Ouch, that’s bad!

    Brad – you should try to get this working because other WordPress functions and plugins won’t work properly either. WP Super Cache uses wp-cron to delete it’s expired files automatically, and WordPress scheduled posts relies on it too.

  7. Henri
    By Henri on 21 February, 2009 pointed to only pointed to localhost is very, very strange. How is it possible?

  8. Steen Öhman
    By Steen Öhman on 22 February, 2009

    Thanks for the tip.

    Had a client with the same problem … now solved!

    Great site you have here … I will back – as they say in California.

  9. Malice
    By Malice on 14 March, 2009

    That pretty much explains why at times my wordpress didnt publish scheduled posts. :D

  10. 5ubliminal
    By 5ubliminal on 21 March, 2009

    Try my plugin: http://blog.5ubliminal.com/48 . And … it works ;)

  11. qdinar
    By qdinar on 11 April, 2009

    http://wordpress.org/extend/plugins/wp-super-cache/faq/ :

    Check your access_logs for wp-cron.php entries. Do they return a 404 (file not found) or 200 code? If it’s 404 or you don’t see wp-cron.php anywhere WordPress may be looking for that script in the wrong place.

    i have wpmu main domain linked to and wp-cron.php returns “200”, i see in log file. so i think it works.

    i do not know why it may not work.

  12. Al
    By Al on 27 April, 2009

    Where’s hosts? I went into etc and theres no hosts

  13. Brad Touesnard
    By Brad Touesnard on 18 July, 2009

    I’ve written a blog post about the problem with Media Temple (dv) / Plesk configuration and how to fix it:

  14. Billige mobiltelefoner
    By Billige mobiltelefoner on 14 August, 2009

    very nice wordpress block, i gust love the design.

  15. smilesquare
    By smilesquare on 10 September, 2009

    After my debugging I also found that some scheduled posts not put into the cron queue that why some scheduled post can post correctly, and some not.

  16. Rene Silva
    By Rene Silva on 23 November, 2009

    Thanks, thanks … It worked like charm. Cheers.

  17. Christine
    By Christine on 30 November, 2009

    Thanks so much for this. This is not the first time I’ve experienced weirdness with my dv. (ie way things are supposed to be.) Thank you again. :)

  18. Jehzeel Laurente
    By Jehzeel Laurente on 2 December, 2009

    oh this is weird. I still can’t fix it until now. Maybe I should move to westhost just like what you did. Hehehe.