Cancel/Stop a currently ongoing scheduled cron event?

Removing / un-scheduling obsolete cron jobs can be achieved using this code snippet. add_action(“init”, “remove_cron_job”); function remove_cron_job() { wp_clear_scheduled_hook(“my_schedule_hook”); } Change the my_schedule_hook to cron’s hook name and add the code in your theme’s function.php file.

WordPress, how to run a function every 12 december?

Unfortunately, you cannot run script on every 12 December. WP Cron can be only defined as interval from first execution of script, so you have to execute script on 12 December with one year interval to do exactly what you want. I will suggest you to create WP Cron job with daily interval and check … Read more

How to force ‘cron_schedules’ every minute instead 1 hour?

You have the wrong period alias in your code You added your personal period in my_cron_schedules() as 61sec: $schedules[“61sec”] = array( but use it in setup_schedule() as 61sek: wp_schedule_event( current_time(‘timestamp’), ’61sek’ , ‘expire_ogl’); The other parts of the code look right.

“Missed schedule” posting bug

You don’t really need a Plugin to define these type of cronjobs in a timely manner. All you need to do is to reliably call the WordPress Cron file which is wp-cron.php The question is if your Webhost allows you to start wget without any path command or if it’s allowed to start it anyway. … Read more

Sending email to all users

Sending mass emails that actually get delivered is not a simple matter at all. Even if your code sends 1000 messages correctly, many if not most of them will get blocked or labeled as spam unless you comply with a long list of mass email best practices. (See also: The FTC’s CAN-SPAM Act – Compliance … Read more

How to fix missing function in wp-cron?

You can also disable the auto wp-cron from loading and setup a manual cron job on your server. Add the following line to your Wp-config.php define(‘DISABLE_WP_CRON’, true); and then on your server/control panel create a cron job to run the following: wget http://www.yourdomain.com/wp-cron.php > /dev/null 2>&1 I run mine every 5 minutes.