Busy Blogging Dot Com

My Blogging Experience As a Professional Blogger

Busy Blogging Dot Com Rss

Wordpress Problem with Scheduled Post Solved

Author: MoneyNing | Categories: Technical | Posted on December 27, 2008

Since Wordpress 2.5, I could never get posts to publish articles at a scheduled timeframe. For whatever reason, all posts would just miss the schedule and not show up on the blog. For a few months, I had to manually change the time to get the posts to show up (or just write posts and immediately schedule them to go out).

I’m happy to say that after months of research and frustration, I finally found the solution to the Wordpress scheduled post problem!

Here’s a brief explanation of the issue I was having:

  • When it came time to publish the scheduled posts in WP, the post wouldn’t publish and time would start counting backwards (for example, if it’s 2 minutes past the published time, it will say “2 minutes to post”
  • Researching it seems to indicate that it was related to wp-cron.php

Solution to the Scheduled Post Issue

The way WP handles scheduling is that whenever a page is loaded (either from your blog or in your control panel), the file wp-cron.php is loaded.  So, in order to troubleshoot the scheduling issue, log in to your server’s temrinal (via SSH or others) and type

wget http://yourdomain.com/wp-cron.php

Obviously, you need to replace yourdomain.com with your own domain (in fact, you need to use the actual URL of where your wp-cron.php is located).  For example, if your blog is within a sub directory called “blog”, it will be at yourdomain.com/blog/wp-cron.php.

If everything is normal, you should see an “OK” message buried under a bunch of other junk.  If you get a 404 error or others, then that’s the first problem you should solve.

The most common problem for many server configuration is the 404 error, so here is a quick way to get this fixed.

  1. Open your /etc/hosts file (this is a text file so use a text editor to open it)
  2. Look within the file to see if your domain is pointing to a different IP than it should be (mine was pointing to 127.0.0.1)
  3. Change the wrong IP in the etc/hosts file to your domain’s public IP address
  4. type the wget code again to see if you get an OK.  If it does, you should be able to schedule your posts from now on!

If you get a write permission error, then you need to make sure wp-cron.php is writtable.

This solution only works if you have terminal access to your server.  If you are using a shared hosting where many of the steps isn’t possible, use this information to talk to your host about the scheduling problem.  They should be able to fix it for you based on this article!

Follow me on twitter! Alternatively, subscribe to my RSS feed or get blog posts through email if you enjoyed this post!

Comments

  1. I’ve been having this problem for a while now so I’m glad that you brought it up. Unfortunately I use shared hosting (HostGator) so I don’t know how to fix this myself… but I just submitted a ticket to their tech support so hopefully I can get it resolved.

    It’s a ridiculously annoying problem.

  2. Joseph: I had this problem for a few months now and trust me I know what you mean. I almost felt like crying when it worked this morning on my main site! :)

  3. MoneyNing,

    Is it possible to transfer from googles blogger to a wordpress format, or is everything done manually? Have you had any experience doing this? Thanks

  4. Stockmanmarc: It’s certainly possible to transfer from blogger to wordpress. Email me as I’ve done it myself and for others before.

  5. I haven’t experienced this particular problem but I do know how frustrating it can be to have problems like this and try to debug them. I’ve done a few myself - what a time sink that can be. So I really, really love it when people take the time to post about the problem and the solution they’ve come up with for it. Thank you!

  6. My web server is running on an OSX box and the hosts file is currently:

    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    ##
    127.0.0.1 localhost
    255.255.255.255 broadcasthost
    ::1 localhost
    fe80::1%lo0 localhost

    Given it says explicitly not to change it, I’m reluctant to try this, but I’m not seeing lots of missed schedule messages. Any more suggestions?

  7. David: It depends on what you error message says when you type wget ….. like the one mentioned in the article but I would add the line that maps your domain and your IP in there if all else fails just to check. If you are afraid of what will happen, you should backup that file first just in case since you can always restore it if it doesn’t work.

  8. Typo above… that should say:

    I am NOW seeing lots of missed schedule messages.

  9. OSX doesn’t ship with wget.

    I tried curl at the command line with my appropriate url but get back absolutely nothing at all in that case.

  10. @MoneyNing

    > I would add the line that maps your domain and your IP
    > in there if all else fails just to check.

    what format should that line take in the /etc/hosts file?

    Thanks in advance!

  11. David: The format is:
    YOURIP YOURDOMAIN

    Note that it should be on a line by itself, with the public IP, followed by a space and then the domain name.

  12. [...] Wordpress Problem with Scheduled Post Solved | Busy Blogging Dot Com WordPress › Support » Missed Schedule - Scheduled Posts Not Publishing With 2.7 [...]

  13. wow suoper

  14. I am confused with this problem for a long time.Thanks for sharing this,I have submit a ticket to my hosting service,hope this gonna work.Thanks again…man

  15. there is nothing appear when i open http://yourdomain.com/wp-cron.php
    its only show nothing…
    how to slove this?

  16. Mirlme: You need to go to a linux command prompt on a server that has wget installed. You aren’t supposed to get anything by typing that into your browser.

    If you aren’t sure what I’m talking about, perhaps asking the tech support of your host will help. Just send them this post.

  17. Im having ‘kind of’ the same issue, actually me it is not related to schedule post, but it is related to wp-cron.php that is pushing my cpu to the max, and slowing all my websites, ( almost not able to post )

    Ive been looking into this issue for a while, but nothing is really resolved on the wordpress forums or anywhere else… Hope you guys can help me?

    When i type wget http://yourdomain.com/wp-cron.php
    I have this :
    HTTP request sent, awaiting response… 200 OK
    Length: 0 [text/html]
    wp-cron.php: Permission denied
    Cannot write to `wp-cron.php’ (Permission denied).

    I have a DV on Mediatemple, and they said they cant troubleshoot me (i have to find it on my own)

    so i found out that the issue is wp-cron.php is called by a script at ‘/var/www/html/wp-cron.php’ and that the correct path is /var/www/vhosts/”domainname.com”/httpdocs/wp-cron.php

    The question is which script is calling wp-cron.php ?

    Hope I can find some help..

    thanks

Post a comment