Articles of wp cron

Posts wont expire

I am having some trouble with scheduling posts to automatically expire (either by deleting or going to draft), every plugin I have tried does nothing and when it reaches the scheduled time nothing happens, which is making me think its probably some simple thing I keep overlooking.. I thought I might be a problem with […]

Cron Job not working in plugin

I have written a plugin that will convert posts to excel format and then email the .xls to an email id. I can make it work with when function is declared in functions.php but does not work with function defined in plugin file. if ( ! wp_next_scheduled( ‘xls_func_hook1’ ) ) { wp_schedule_event( time(), ‘hourly’, ‘xls_func_hook1’ […]

Getting Error “invalid secret string” by running wp-cron.php manually

I am trying to run the wp-cron.php manually by calling it that way: Disabling the auto cron function with : define(‘DISABLE_WP_CRON’, TRUE); produces the same error. What could be the issue?

Need to execute a cron job

I need a cron job to execute the following url The problem is that it requires to be logged in as admin, what are my options? I’ve tried a few plugins but they use hooks instead of just executing a url and the cron jobs provided by the control panel does not log in […]

How to Better Control WordPress Cron Jobs?

I have a bunch of standalone WordPress sites, and WordPress Multisite Network of Sites on my server. There are times where there are too many sites all running cron jobs too soon in proximity. I am looking to better control when cron jobs are triggered on each WordPress website. Is it possible to disable WordPress […]

WordPress Caching – Transients API or “update_user_meta ” Cronjob?

I’m trying to set user meta based on queries. Basically, things like IF the query returns true, set this or if not, set this (or don’t set it, if it is true). This works great but the problem is I currently make the call EVERTYIME to check true or false which I know is bad […]

Getting this code to work in Multisite

I’d like to run this code via cron on multisite. When I use the admin_init hook the code executes and works perfectly, deleting the blogs, however when I set it as a cron, and then run the event with the WP Crontrol plugin, the blogs don’t get deleted. What gives? register_activation_hook( __FILE__, ‘remove_blogs_activation’ ); /** […]

Cleaning “cron” from options table, will affect anything?

I have some scheduled events in my WordPress site. For that I use a cron job, so it has created an option in the wp_options table. After some days, my site is getting slow. When I check my database, it has more than 2MB of data in the cron field, so I am thinking to […]

Schedule event every second thursday of the month

I’m working on an email system and they want it automated to send out emails every second thursday of the month. I’ve got the PHP sorted out and ready to fire a callback to send the emails, but I’m a complete newbie when it comes to cron and scheduling events. Essentially, I have this: echo […]

Why Should We Use wp_clear_scheduled_hook and What it Does?

I am new to cron job. After reading this article I was able to run a function every hour using wp_schedule_event. There is a quote on “Don’t forget to clean the scheduler on deactivation” in that page. I read the documentation of wp_clear_scheduled_hook. But still I could not understand why we should use wp_clear_scheduled_hook and […]