Tagged Questions

wp-cron refers to a WordPress subsystem that allows for the scheduled execution of code

learn more… | top users | synonyms

0
votes
0answers
8 views

Constantly schedule posts for two weeks in advance

I was wondering if there was a way to automatically and constantly have posts scheduled for two weeks in the future. Example: I have a post that I want published every Tuesday at 1pm, and I want ...
2
votes
0answers
55 views

How to run WP Cron the right way?

I have WordPress Multisite with several sites. I set up DISABLE_WP_CRON to true in my wp-config.php. How to run wp-cron.php the right way? If we set up cron task with wget or curl we have 30 sec ...
0
votes
0answers
42 views

Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?

I'm trying to update the post meta of all published posts hourly (via wp_cron) with the code below: if ( ! wp_next_scheduled( 'postviews_updatedcounts_hourly_event' ) ) { wp_schedule_event( ...
0
votes
0answers
16 views

Cron job disappering without notice?

I have a cron job (doing an sync against an external system) running every 10th minute in a multisite-install. For 2 out of 3 sites it is working perfectly. On the third site the scheduled job is ...
0
votes
1answer
41 views

automatic send email at custom time

I want to send an automatic email every day at 10:00 I tried this code $timeN = date('H:i'); $timeS = date('10:00'); if ($timeS == $timeN) { $to = get_option('admin_email'); $nfrom = "my ...
0
votes
0answers
27 views

Custom Event for Wordpress Cron Job Not executing

Method to Execute at Certain Interval function informant_main_action(){ die('working'); } Custom Schedule for Cron Job function my_cron_definer($schedules){ $schedules['weekly'] = ...
0
votes
2answers
29 views

How to make a cronjob type plugin

Hi i am new on wordpress and has been given a task to make such a script that will fetch posts by categories and shoot email to subscribers. The table structure for subscriber is below Subscriber Id ...
0
votes
0answers
24 views

wp_next_scheduled not working with variables

Here is the code: <?php while ($parent->have_posts() ) : $parent->the_post(); ?> <?php $timi = get_field('timi', $post->ID); ?> <?php $timi2 = $timi / 2; ...
0
votes
0answers
25 views

How do i set cron job for my WordPress site?

My target is to run a file to be executed on each day whether the WordPress site runs or not. How to execute cron file? I have got stuck in this is issue. This is new task for me and i don't got ...
2
votes
1answer
156 views

WP Cron and wp_insert_post

I'm trying to insert posts using a cron job, but I keep running into errors where WP is missing functions (is_user_logged_in, wp_get_current_user). Is there a proper way to run wp_insert_post using a ...
0
votes
3answers
60 views

setting up a wp cron job

I am a bit new to wp-cron job. I think i understand the concept but lack the implementation. i read a lot of tutorials on how to implement including this post: Run function at specific time but still ...
0
votes
0answers
33 views

Cron job not firing

I'm having this problem where cron jobs doens't seem to post delayed posts.. I'm using this cron job wget -O /dev/null http://domain.com/wp-cron.php?doing_wp_cron Am i doing something wrong?
0
votes
0answers
27 views

Cron job to delete post by title

I've searched a lot and I didn't find nothing that could help me. So, I want a cron job to automatically delete posts that have no title. Why I want that? I have a IFTTT recipe that automatically post ...
0
votes
1answer
43 views

Display a random tag but using cron to control frequency of change

Background - I have created a shortcode in functions.php which adds a single random tag with it's link and description to a widget in my sidebar. This is my existing code... function ...
0
votes
0answers
32 views

Scheduled event occurring each page load, but supposed to happen daily

I have a scheduled event that is supposed to occur only once a day at 12am. However, for some reason my scheduled event is happening on each page load and I can't figure out why. The default ...
1
vote
1answer
106 views

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 ...
4
votes
1answer
270 views

wp_delete_auto_drafts() deletes links in menus

Since yesterday the wp_scheduled_auto_draft_delete cron job somehow deletes all page entries from our menus. All entries in the table wp_postmeta with meta_key = '_menu_item_object' and meta_value = ...
0
votes
2answers
24 views

Pages for Cron use Only?

so I've got a bunch of custom page templates that are scripts that are meant to be run by cron to update various things on my wordpress site, there are not meant to be viewed by regular site users. ...
0
votes
0answers
43 views

Expire a post with meta_value after two weeks

I am trying to use the below code to query for some posts and then change a meta_value in order to "expire" it after two weeks time. I can't get this to work and it's difficult to test since I can ...
1
vote
1answer
167 views

When to use wp_schedule_single_event for async / non-blocking processes?

I have noticed this pattern in some plugins lately: <?php function MY_CRON(){ wp_schedule_single_event(time(), 'MY_ACTION'); } add_action('save_post', 'MY_CRON'); function MY_FUNCTION(){ // ...
0
votes
0answers
46 views

custom cron interval is not working

I am trying to create custom interval for cron schedule with below code but it is not working, function cronschedules($schedules) { $schedules['custom'] = array( 'interval' => 36000, // seconds ...
0
votes
1answer
60 views

Custom interval is not working

I am trying to create custom interval for cron schedule with given user input, but its not working. Here is the code: add_filter( 'cron_schedules', 'custom_cron_schedule' ); function ...
2
votes
1answer
145 views

Send email daily from WordPress site

I customized a calendar plugin which shows today's birthdays and current month's list of wedding anniversaries in the home page of the site. I wrote a code in that plugin's displaying page using ...
0
votes
0answers
56 views

WP Cron debug issue - running on staging, not on live

I realised a plugin's wordpress cron wasn't running on my live site, so I installed WP Debug Cron to investigate the issue. All the custom and core events show Next Execution as being in the past. In ...
0
votes
1answer
81 views

Issue with wp_schedule_event()

I am trying to set up an event on a custom interval that will grab new posts from an Instagram search and create them as wordpress posts. I had the code working on its own page, and now I am trying to ...
0
votes
0answers
108 views

wp-cron.php - timeout

I found via Query Monitor plugin, that there is some HTTP request error during page load. I looked at the error table, and here I found that problem is with this: FULL_IMAGE How can I delete this ...
0
votes
1answer
123 views

wp-cron still running even though DISABLE_WP_CRON is true

I have created a cron job to run wp-cron.php for me but I am seeing in my FPM logs where it's still running. From what I understand, is that with the cron job it wouldn't be hitting FPM to create any ...
5
votes
1answer
233 views

wp_schedule_event won't accept args

I'm trying to schedule event on hourly basis but it doesn't work. Why, I can't understand. Here is a function that i use to schedule event. add_action( 'scheduled_update_feeds', 'update_feeds', 10, ...
0
votes
0answers
18 views

Save automatically data to user profile once or twice a day [duplicate]

The main goal : I am working on a panel which will display statistics of my user websites (external website). For that, I use the Google Analytics API. I save the Google Analytics profile number in a ...
0
votes
1answer
123 views

What is the use of wp_schedule_event hook?

I want to do a cron(executes function at specific time, like email,db backup etc) job. I searched in wordpress, i got this wp_schedule_event Here they say it will execute job when someone visits ...
0
votes
1answer
156 views

WP Cron: Save third party data as user meta

Editors note: Twitter ID and Google Analytics only serve as examples and are exchangeable. TL;DR I want to save external data in a user profile once or twice a day. I added two custom fields in my ...
0
votes
1answer
388 views

Make posts automatically from an Online XML file through wp cron job

I want to import posts from a RSS feed using the WP Cron API. Here is the link to the XML Feed. I activated different Feed Aggregator wordpress plugin but it gives error. Problem: FeedWordPress ...
1
vote
1answer
111 views

WP_Cron script not updating all posts in loop

I've had an issue with this piece of script for a month now http://pastebin.com/f6LqgqQS. What the script is supposed to do is loop through all my posts, pull the like count from the facebook graph ...
0
votes
0answers
267 views

WP-Cron tasks scheduled but not running

I'm working on a particularly large WordPress multisite network, and have been struggling with WP-Cron. It seems that WP-Cron tasks are being scheduled, but not run. The WP-Cron tasks are not being ...
0
votes
1answer
57 views

what is firing cron

I've been having problems while trying to setup a simple cronjob. A lot of the WordPress tutorials like this one http://tommcfarlin.com/wordpress-cron-jobs/ specify a crontab with some time schedule ...
1
vote
1answer
239 views

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 ...
0
votes
0answers
106 views

Cron Lock Timeout, when to use?

When is it a good idea to use this constant in relation to WordPress Cron? WP_CRON_LOCK_TIMEOUT
0
votes
1answer
267 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
1answer
105 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
0answers
25 views

Break a Wordpress function to run in patches and re-continue

I am new to PHP and coding and I am really not a coder but I try to modify and use existing codes. I have a function which I am trying to run when needed for all users within Wordpress to do an ...
0
votes
0answers
73 views

wp_schedule_single_event running twice

I have set up a meta box with a checkbox, so when checked and the post is saved, a scheduled event is registered to send an email to all users (around 1200) in the background. Sometimes the emails ...
0
votes
1answer
273 views

Set post to draft after set period based on post_modified date

I have a custom post type for the user profile page. My client wants all users to update their profile at least once a month, so we want their profile (custom post) to be automatically set to draft ...
0
votes
2answers
40 views

Hook/Cron Problem

I have this function in my functions.php <?php if ( !wp_next_scheduled('re-post2') ) { wp_schedule_event( time(), 'hourly', 'rep-post2' ); } function repostads() { global $wpdb; ...
0
votes
1answer
296 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 ...
0
votes
1answer
43 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 ...
0
votes
1answer
64 views

Using a Cron Job to dynamically populate a field ONCE, and then making the field blank the next time someone visits page

I'm probably going to butcher explaining what I'm trying to do, so bare with me. Essentially I'm working on a custom Contest type of solution for a client. I'm using Gravity Forms for the users to ...
0
votes
1answer
100 views

Manually trigger a wp_schedule_event item?

I have successfully added an event via wp_schedule_event and I'd like to trigger it manually without disrupting the existing schedule. Is there a way to tell WP to execute an event immediately ...
1
vote
0answers
64 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 ...
0
votes
0answers
38 views

Wordpress Cron Job Counting Up and Not Down

I'm having a strange problem in which a WP Cron Job is counting "up" and not "down". Thus the job never runs. What I mean exactly should be clear from these outputs: [19-Sep-2013 23:33:51 UTC] ...
0
votes
1answer
77 views

Regenerating array key for wp_schedule_event args

I've been working on this the last day with no luck. Is there any way to update a stored args array key for an event scheduled? Reason I ask is I have array args that look like this when scheduling a ...