Support » Fixing WordPress » Help with cron job to schedule time delayed posts

  • Hi there

    I have set up my cron job in bluehost standard cron job manager to run hourly BUT any time I do a post with a future date or time it posts immediately. I have no idea why.

    According to the bluehost help guide I only need to enter the file name and timing to run the job which I have done. I know the job must be activating as prior to installing the cron job the posts didn’t publish at all. I have set the job to run hourly

    I have edited the time of the post and pressed save and it publishes immediately. The same happens if I press publish.

    Here is my cron.php file. I thought I’d check that this is the latest and is correct, in case there is some error in the code that is causing it to publish immediately

    Thanks

    [contents of wp’s cron.php removed]

Viewing 15 replies - 1 through 15 (of 20 total)
  • Don’t know if these will help, but there are several suggestions in these topics, some of which worked for some people and not for others: http://wordpress.org/support/topic/165238?replies=72
    http://wordpress.org/support/topic/163152?replies=13

    thanks bernard i will take a look at those threads

    I took a look and none of those solve my problems

    Can someone please advise me why all my posts publish immediately even if it is scheduled for a future dated time?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    talia: WordPress does not need any cron job to work properly. It has it’s own internal system, called wp-cron to handle this stuff.

    What external cron job did you set up anyway? There is nothing to hit from a normal external cron process.

    hi otto42

    i set up cron.php as a job

    before i did that the posts didn’t publish at all. they would get to the scheduled time and say they were x minutes old but never publish

    i am using fantastico on bluehost

    initially someone (you i think?) said the problem was that the job wasn’t scheduled in the cron job manager so i set it up. since doing that all posts publish immediately no matter what time i schedule them for

    how do i fix this please?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    i set up cron.php as a job

    LOL. Okay, that would not actually *do* anything, because cron.php, by itself, does nothing at all. It just defines a bunch of functions. Running alone, it will do nothing whatsoever. 🙂

    before i did that the posts didn’t publish at all. they would get to the scheduled time and say they were x minutes old but never publish

    I guarantee you that running cron.php did not cause this to occur.

    how do i fix this please?

    First, you might as well get rid of that cron job and then see what happens.

    Second, make sure that you’re doing things correctly. A lot of people seem to be confused by how it works, but I don’t understand why. To future publish, you set the date and time and then click “Publish”. It won’t show up until that time rolls around.

    If it’s not working, then you need to carefully describe what happens. Details are important here.

    Otto: I have now deleted that job as you suggest.

    If it’s not working, then you need to carefully describe what happens. Details are important here.

    1. I went into write a new post
    2. I typed up a post with “test” in body and heading
    3. Next to publish immediately, select “edit”
    4. Add 5 minutes to the time that it has in there (i.e. 5 mins from when i started the post)
    5. Click publish
    6. The screen now says Your post has been saved. View post | Edit post. The post has disappeared from the screen
    7. Click VIEW POST shows the post on the blog, published at the time I selected (ie 1145), even though the five minutes are not up

    I tried a second time and added 1 hour and 5 mins to the post. Exactly the same problem

    I tried a third time and added 1 day to the post time. Exactly the same problem. It posts immediately. Very frustrating!!!

    Your help is appreciated as I have 2 other blogs I want to convert to wordpress but have held off until I can fix this problem.
    Thanks

    Hmmm this is weird. I have now checked the dashboard, as I planned to edit the posts

    Post #1 says it was published 6 mins ago test — Private
    Post #2 says it was published 59 mins ago test 2 — Private
    Post #3 says it was published 24 hours ago test 1 day — Private

    How can that be? Post #3 is dated 7 November at 23:45
    It seems to be reversing the time. I don’t get this at all.

    So I did a 4th post dated 1 week from now, 2008/11/13 test 1 week — Private

    It has also published immediately but it shows the future date in the dashboard

    Just as a note. When you click “View Post” it will always show you your post, no matter what time stamp you put on it. If you want to find out if your post truly published or not, never click view post. Go visit your site instead.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Click VIEW POST shows the post on the blog, published at the time I selected (ie 1145), even though the five minutes are not up

    Yeah, I think you might be getting confused here. You can always view the post on your blog. It’s your post, of course *you* can see it.

    But if you actually go look at the main blog, is it really there? Just because you can see it directly means nothing.

    YES of course the post is on the main site. I wouldn’t be here if they didn’t!!! I’ve deleted them now but if I go to the blog section they all show up

    As an experiment I did another post and added a day to the time in the post. It shows up immediately in the blog and on the sidebar listing of recent posts dated 9 November.

    I’ll do a couple of screen shots for you in a moment

    Hi again Otto and Bernard

    http://whydietsdontworkclubmembers.com/images/wddw-wp1.jpg
    In this you can see that the screen capture from today (8 November) but it says the post dated 9 November was posted 24 hours ago.

    http://whydietsdontworkclubmembers.com/images/wddw-wp2.jpg
    Shows the test posts are on the blog now even though they are dated 9 and 15 November 2008.

    No reason for them to appear. And odd that it seems to do the inverse. If the post is scheduled to appear in 5 minutes time it says it’s 5 mins old. If it is scheduled in a hour it becomes an hour old, and if scheduled in 24 hours it says it was published 24 hours ago

    Weird!

    I’ve just tested this feature again just to make sure (2.6.x) and from what I can tell, if you are still logged in as admin, the test posts *will* still appear when viewing the main blog/site, but as pointed out before, will be post-dated.

    However, if one were to view the site whilst as a visitor/not logged in (I use a separate browser for testing) the post will not appear until the published date arrives.

    As for the ‘date’ under “Manage”, my test post shows the date that the post should be published (I set it for the 14th of Nov in this case)

    Hi Mosey
    Thanks for that suggestion. I know I have logged out and checked the posts the first time I was testing this but not recently

    I will try testing a few posts and then logging out to see what shows on the screen!

    I think I’ve worked out what the problem is and it looks like it is a wordpress bug

    If I tick the private posts box, it posts immediately no matter what time or date is on the post

    But if I don’t tick the private posts box so they are public then it works fine and schedules the posts

    This must be a bug????

    I’d appreciate it if someone else could test the private versus public post options to see if that is what is screwing this up! Also, I am on 2.5.1 so maybe this is fixed in a later version?

    The private posts seem to have an inverse relationship with the time scheduling function

    Says it was posted 24 hours ago but it was scheduled to post 24 hours from now
    24 hours ago test 1 day from now — Private

    Says it was posted 53 mins ago but it was scheduled to post 1 hour from the post time
    53 mins ago test 1 hour from now — Private

    Says it was posted 3 mins ago but it was scheduled to post 5 minutes from the post time
    3 mins ago test 5 minutes from this time — Private

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Help with cron job to schedule time delayed posts’ is closed to new replies.