Questions tagged [cron]
The cron tag has no usage guidance.
299
questions
1
vote
1
answer
1k
views
After plugin options changed hook
i am looking for a hook that fires after the options for my plugin have changed.
I have an option named "interval", it basically registers a cron schedule. Now, id like the change to take effect, ...
0
votes
1
answer
1k
views
Plugin has a cron job, but the function doesn't actually run
I've been working on a Wordpress plugin, and it requires a cron job to do some work. I've got the job setup and scheduled and I can see it in the cron using one of the plugins which lets you see the ...
2
votes
3
answers
5k
views
Run function at specific time
I have a WordPress function that I want to run once daily at a specific time. How should I go about doing this, since WP cron cannot be set to a particular time?
10
votes
2
answers
7k
views
Do WordPress cron jobs slow down page loading?
If a user visits a site and his visit triggers a cron job that is quite intensive, the page load speed will be slower for him right? As I understand the page doesn't wait for the cron job to execute ...
0
votes
1
answer
879
views
Cron jobs repeating themselves
If I have a function set to run every 5 minutes via a WP cron job, and I have only one visitor during a day, does his visit trigger just one run of that function or all the runs that have been amassed ...
0
votes
1
answer
1k
views
Adding custom cron_schedule prior to wp_schedule_event
I am trying to add a custom cron_schedule interval inside a plugin and then use that custom interval to schedule a cron event when the plugin is activated. It seems that the custom interval is not ...
4
votes
1
answer
142
views
Cron firing my function everytime wp-admin is visited
This is a MU-plugin I'm developing, and I want it to run hourly. Unfortunately, it's running every time I visit any site's wp-admin page. I've used the Debug Bar plugin with the Cron plugin, and it ...
0
votes
1
answer
144
views
How can I prove if wp cron is running my task if I have DISABLE_WP_CRON set to true
I am trying to trigger a wp cron task via a real (linux) server cron and have followed online instructions to add this to wp-config:
define('DISABLE_WP_CRON', true);
My cron job does this :
wget -...
5
votes
1
answer
630
views
Get frequency of scheduled event
How do I get the frequency of a scheduled event?
I am writing a plugin, that would do something in a user defined schedule.
The way I am trying to do this, is creating a custom cron schedule, which ...
1
vote
2
answers
7k
views
WP Cron job every 1st and 15th of the month
Trying to set up custom schedules for WP Cron, knowing that they use an interval is it even possible to set up a cron job for every first of the month? As well as every fifteenth. This is what I have ...
0
votes
0
answers
287
views
Wordpress can't seem to handle tens of thousands of scheduled posts? Cron Breaks
I have a website listing doctors in the us. I'm spreading out the posts over 2 years, but I have about 2.8 million doctors to list. Right now I'm adding the post automatically via a custom script, and ...
1
vote
1
answer
1k
views
WP Super Cache All Pages [closed]
I didnt find it but is it possible to run at night all pages so the next morning the whole website is cached?
Or are there other plugins who does this job?
I hope someone can help me!
Thanks!
0
votes
1
answer
347
views
Cron job to call php to email last 24 hours posts
We have been trying to call via CronJob a PHP script that will email the past 24 hours posts using the 'post_type' = 'reservations' filter.
<?php
query_posts( array( 'post_type' => '...
4
votes
1
answer
3k
views
Need to execute a cron job
I need a cron job to execute the following url
http://www.mywebsite.com/wp-admin/admin.php?page=myvideoblog/mvb_main.php&action=processfeed&updatefeed=67
The problem is that it requires ...
0
votes
1
answer
774
views
Refresh page using Cron after any post is published
I would like to refresh page after any post(custom post type) is published, how do I refresh page using the Cron after any post is published? Can anybody tell me in which direction should I go? I ve'...
0
votes
1
answer
2k
views
How to use wp cron job to run a function
I have one function: "update_user_like" to sum all facebook likes from all user's posts.
How to run that function at 3am every day by wp cron job?
Thanks much!
3
votes
2
answers
3k
views
What happens when wp_cron is deactivated in Wordpress?
In a Wordpress 3.5.1 the apache log generates the following error related to wp-cron.php:
[18/Jun/2013:10:53:21 +0200] "POST /wp-cron.php?doing_wp_cron=1371545601.7393701076507568359375 HTTP/1.0"
...
0
votes
1
answer
192
views
Cron Job variable not accessible
I am currently running a cron job on my cPanel to update a variable containing exchange rates, how can I make this variable available to functions and pages in my wordpress site?
My command in cPanel ...
0
votes
1
answer
318
views
WordPress Cron Schedule the if and else statement
I have a custom php loop/function written that works in the following way
$start = strtotime(date("Y-m-d H:i:s", strtotime("+5 hours")));
$end = get_post_meta( $post->ID, '_limited_dates_to', true ...
0
votes
1
answer
212
views
setting featured image is not working while running script in background, works when running that script from browser
I have creted a script which will fetch content from one of my site and automatically create new post in my wordpress blog.
When I am running that script from browser, its working really cool! post ...
0
votes
0
answers
619
views
Using mysql queries to delete custom post types based on meta_value
I am trying to create a cron job to run on my server which deletes a custom post_type (post_type = event) from my databse based on a meta_key (st_date) and a meta_value (the date the event took place ...
0
votes
1
answer
204
views
Interrupted cron script sending me hourly emails. Please help!
One of my Wordpress installs (cPanel VPS) had a cron job (backup to Dropbox script) that was interrupted. Ever since the interruption I receive hourly emails from root@ cPanel/WHM:
-Excessive resource ...
4
votes
2
answers
2k
views
run a cron task without obstructing page load?
I have a plugin that lets users upload post attachments via AJAX in the admin area. I later try to push these files to DropBox via their REST API. It almost works. The issue is with WP cron task which,...
6
votes
1
answer
9k
views
Better handling of WP-CRON server load abuse
There are multiple reports on how wp-cron is a far from ideal solution because it runs every time a page is loaded, which is unnecessary in most scenarios (one scenario in which it would be necessary ...
3
votes
1
answer
793
views
WP Cron emails not working
Running wp 3.5.1.
I have 2 plugins that work in part. They do everything nice. If I click to send emails, they send the emails. However the scheduled emails are not being sent.
The plugins are:
...
1
vote
1
answer
179
views
Are uploads directories created on a schedule?
I have a cron job that alerts me to modified files on a couple of WordPress installs. Two of them alerted me tonight to the creation of apparently empty folders like
/home/foo/public_html/wp-content/...
3
votes
1
answer
595
views
How to make wp cron job not fire immediately?
I'm scheduling a job in wp cron:
add_action('my_cron_hook', 'my_cron_action');
wp_schedule_event( time(), 'interval1', 'my_cron_hook' );
function my_cron_action(){
//do something
}
The ...
1
vote
1
answer
3k
views
Is it safe to run wp-cron.php twice if the first instance takes too long?
Let's say I disabled "DISABLE_WP_CRON" in wp-config.php
Is it OK to run wp-cron.php twice overlapping?
I've noticed sometimes wp-cron.php needs several minutes. I'd give it a full hour but the ...
19
votes
6
answers
20k
views
WP Cron Doesn't Execute When Time Elapses
The goal
I want to use wp_schedule_single_event( ) to execute a single event that sends me an e-mail 8 minutes after the user submits a form.
The issue
The following code is in my functions.php:
...
2
votes
1
answer
5k
views
How do i schedule cron in wordpress for each second?
I want to schedule a cron job in Wp3.5.1 to sending email to those customer whose appointment is pending.
here some code am trying:
For the testing am scheduling corn for each second to insert row ...
0
votes
1
answer
2k
views
”doing_wp_cron” in URL even if ALTERNATE CRON is not in wp-config
The insertion of ?doing_wp_cron in Wordpress’s URL is very well documented here.
My problem is a little different. I turned on the ALTERNATE_WP_CRON feature in my wp-config file a few days ago. Then, ...
2
votes
2
answers
1k
views
Force Cron to run only on one server
Given a site running on server A and server B with a load balancer, shared database/etc, and a regular wp-cron task, how would I make sure that wp-cron only runs on server A, never on server B?
3
votes
1
answer
701
views
Scheduled Posts and wp-cron - Why don't scheduled posts publish if too old?
I notice that the documentation for wp_schedule_single_event mentions the following:-
The action will fire off when someone visits your WordPress site, if the schedule time has passed.
However ...
5
votes
1
answer
2k
views
When does next Cron Job run (time from now)?
I would need to know how much time is left between now and the next time a specifc Cron Job is done.
For another answer I built a basic cron inspector plugin which can be found here.
Reason I'm ...
3
votes
1
answer
1k
views
Trigger a cron every 24h GMT -8
I' like to run a cron every 24 hours at midnight PST ( = GMT -8 )
This is what I have
if ( !wp_next_scheduled( 'cron_hook' ) ) {
//reset on 00:00 PST ( GMT -8 ) == GMT +16
$timeoffset = ...
4
votes
4
answers
4k
views
Running WP Cron on specific local time
The scenario is to run insert_post function every midnight (00:00) of local time. Must run daily on weekday.
function add_daily_task(){
if((date('l', time()) != 'Saturday') || (date('l', time()) !...
0
votes
2
answers
111
views
How to do some action weekly?
For each new post, I add News category.
And I want to delete this category from each post after 7 days.
I already know to "delete" the new category but how to run it every week ?
0
votes
1
answer
3k
views
Create wp_cront events dynamically upon user submission
Is it possible to set up new wp_cron jobs dynamically upon a certain action?
I have a form submission (I'm using Gravity Forms, so have several functions set up on several of their hooks already) ...
7
votes
2
answers
2k
views
How is WP Cron Locking implemented?
WordPress takes measures to ensure that a cron task doesn't run twice when it should run once, e.g. once every hour when an hourly schedule is given, rather than the occasional twice at the scheduled ...
3
votes
0
answers
1k
views
wp_schedule_single_event function not working
I am testing the wp_schedule_single_event function and it is currently not working on my upgraded version of wordpress.
It looks like the event is being scheduled but the code in my hook is never ...
1
vote
0
answers
334
views
Is it possible to use `wp_schedule_event` with real cronjobs?
I hate the way Wordpress Cron Jobs run, so I disabled them:
define('DISABLE_WP_CRON', true);
and want to run a real cron job instead:
wget http://www.myserver.com/wp-cron.php > /dev/null 2>&...
3
votes
1
answer
1k
views
get_posts inside cron
Edited to rewrite my question
I'll try to be as clear as possible, as I need to get this resolved quickly.
I disabled WordPress' cron, and added a real cron job on my server to call wp-cron.php ...
1
vote
0
answers
76
views
Problems with cron
I have a this code that delete some post meta at al 7:55 hour of the server:
if ( !wp_next_scheduled('borra_meta_datos') ) {
wp_schedule_event( mktime(7, 55, 0, date('n'), date('j')), 'daily', '...
3
votes
0
answers
55
views
How ( and mostly at what time ) can i prevent the alternate cron from running?
I'm using the alternate cron version, but i need to prevent it from running on some calls, how can i do this?
In the cron.php file i've seen on line 225
if ( defined('ALTERNATE_WP_CRON') && ...
17
votes
3
answers
12k
views
Check if function called by cron job
I have a function that I only want to run via a cron job. Is there a way I can check that a particular scheduled event is calling this function and not anything else?
3
votes
2
answers
6k
views
Delete posts from a post type automatically via Cron
how can I use Cron to delete posts of a certain post type once they reach a certain limit, like keep maximum 50 posts?
The reason is that these posts are being imported automatically periodically, so ...
2
votes
2
answers
7k
views
Sending out scheduled emails
Will wordpress run cron if I have scheduled emails to send? Seems like if no visit (request) is made to the site, scheduled tasks won't run and therefore emails won't be sent eg. hourly.
According ...
2
votes
1
answer
373
views
How to remove unused avatar uploads in buddypress [closed]
Im seeing in my wp-content/uploads/avatars folder that there are tons of avatars from when I created test users, but changed the avatars. So, i’m assuming that even if the user changes their avatar, ...
4
votes
1
answer
495
views
Recurring scheduled task help
I'm trying to set up a scheduled task in my Wordpress installation which will (eventually) run a script to send an email once a day with a load of data in.
However I can't seem to get a scheduled ...
0
votes
1
answer
576
views
How to set-up multiple cron task with wp_schedule_event so that they do not overlap?
I'm using a cron to take data from Facebook and i have divided the job into three calls, to avoid making to many call all toghether, now how do i set up calls so that they don't overlap?
// Set the ...