WordPress.org

Ready to get started?Download WordPress

Forums

howto disable wp-cron (5 posts)

  1. Ragno
    Member
    Posted 4 years ago #

    Hi, I have a problem with my blog (wich scores 30.000 unique users a day), since some days looks like that wp-cron is acting oddly. It uses a lot of CPU and i see it being hanged as process.

    Besides the problem wich causes that, i really would like to disable wp-cron to use my internal linux crontab (since i can do it and i like it more), i found an interesting howto here:

    http://blog.dreamdevil.com/index.php/2010/01/29/run-wordpress-tasks-from-real-cron-job/2/

    which tells to insert in wp-config.php this command:

    define('DISABLE_WP_CRON', true);

    I've done that (at the end of the file) but seems it's not working since i keep seeing wp-cron spawning in my process list.

    I'm using wordpress 2.8.4 and I can't upgrade since the blog is not mine (i just manage it) and the owner is not thinking about it.

    Someone know a way to disable wp-cron in a safe way then?

    Thanks!

  2. maorb
    Member
    Posted 4 years ago #

    I'd be also happy to know also about that, do you have some insights about this situation?

    Thanks

  3. Marc
    Member
    Posted 3 years ago #

    Me too!

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 3 years ago #

    Adding that define will work, but not at the *end* of the wp-config file. Add it to the beginning, with all the other defines.

    If you want to make the wp-cron run on a real cron schedule system, then make a copy of wp-cron.php with a new name, edit it, and change this code:

    if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') )
    	die();

    To this:

    if ( defined('DOING_AJAX') || defined('DOING_CRON') )
    	die();

    Then you can call your new cron job from a normal cron interface on some form of timed basis.

    Note, doing this will likely *increase* the load on your server. WP-Cron is incredibly lightweight, much more so than a normal cron system. If you have problems with wp-cron, then you might try using the ALTERNATE_WP_CRON define (just define it to true in wp-config).

  5. Tara
    Member
    Posted 3 years ago #

    I am a layperson, and after reading this thread I am totally confused.

    As I undersatnd (my understanding may be wrong) Why the cron has to be running all the time? What's the purpose? Why need to have it be running itself? I just don't get all this.

    Otto, can you please shed somelight for a non-proggramer like me.

    thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags