Questions tagged [wp-cron]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

wp_cache_flush() function within a cron task [closed]

Can anyone explain to me what I need to do to implement this solution that a WordPress.com Happiness Engineer suggested to me below. I have a website where the post views for each post are not being ...
Steve's user avatar
  • 1
0 votes
2 answers
33 views

Checking wordpress cron hook for post and updates | what are the other cron values from wp-cli

Just wanted to ask how can we check which hook is being used for post updates or pages updates, as listing from wp cron event list, there are multiple crons but is there a wayu to recognize post and ...
Hamza Mohammad Khan's user avatar
0 votes
0 answers
11 views

Is there a technical difference between invoking `wp-cron.php` and using `wp cron event run`?

For years I've been running cron by setting DISABLE_WP_CRON to true in wp-config.php and then setting up a cron on my server that runs like this: * * * * * cd /path/to/site/public_html && /usr/...
shaune's user avatar
  • 101
0 votes
0 answers
14 views

What are scheduled callbacks?

I was taking a look at the inner workings of the Cron System, and found something odd: apparently, you can set a callback to event recurrence schedules. However, I can't find any documentation on that ...
Buzu's user avatar
  • 101
0 votes
0 answers
10 views

WP Cron based on array list

I've never used WP Cron in my life and I'm struggling with a task. I have the following array: $times = array(10:00, 15:00, 21:00); I need to schedule this times so I can call the enable_update() ...
Zagaz's user avatar
  • 11
0 votes
0 answers
78 views

Submit CF7 form programmatically with WP-Cron?

We need to check daily if our CF7 form is working properly (form submission data arrives to support's email). So i need a way to programmatically submit the form on frontend. I tried with WP-Cron but ...
Ion T's user avatar
  • 15
0 votes
1 answer
38 views

Cronjobs at night - but not the rest of the day

I have a cronjob, that at the moment runs hourly - I would probably prefer it to only run hourly between 2am and 5am. Is that possible with some kind of scheduling to tell Wordpress, that it is hourly ...
denlau's user avatar
  • 103
1 vote
1 answer
20 views

Cron Job not working

I am trying to trigger a function using cron job in a time interval of 1 minute but it is not working, am I missing something? register_activation_hook(__FILE__, 'my_event_recurring_activation'); ...
v morgesh's user avatar
0 votes
2 answers
83 views

Function attached to cron job not running but will run if called manually

I have a cron job set up with the following code in my functions.php file I have a CPT with a custom field that defines an expiration date for each post. All I am doing is checking if the date has ...
grzybowski1911's user avatar
0 votes
1 answer
70 views

Wordpress "wp cron event run" as Siteground cron job

Is there a syntax that will allow me to run "wp cron event run" as a Siteground cron job? I found this example that runs through a third party application. I'm wondering if this command can ...
Rip's user avatar
  • 3
0 votes
1 answer
61 views

Execute scheduled cron with ajax call to wp-cron.php

According to this question where my doubt on how to schedule an email sending each 24 hours, I've modified my plugin code to use a custom action hook and the wp_schedule_single_event() to achive the ...
ICTDEV's user avatar
  • 123
0 votes
0 answers
49 views

Wordpress Cron job hook running multiple times

Here is my code in its basic form for a wp cron job I want to run only once daily: add_filter('cron_schedules', function ($schedules) { $schedules['daily_reminder_check'] = array( '...
MikeeeG's user avatar
  • 136
0 votes
0 answers
35 views

How to upload files on s3 Bucket in Background Task uisng PHP WordPress?

I have a website where users upload their videos. Videos length is more than 600 MB so I want to run videos upload in background and update in database. Users will also be notified via email. So cron ...
Xabby's user avatar
  • 101
0 votes
0 answers
14 views

WP Cron, how to speed it up

On my site, I have quite a few cron jobs running. Everything is running smoothly, except the cron jobs end up queuing all time. My server load is only at 40%, so I assume I can handle more cron jobs ...
Mads's user avatar
  • 1
0 votes
1 answer
22 views

CPU Overloading due to some hooks

I have some functions restricted in some hooks. The purpose of these hooks was to have consistent author name in the DB(which is a product attribute) and also update the display name. I placed this in ...
Varun Muchanapally's user avatar
0 votes
0 answers
17 views

Custom set interval is not working

I want to published custom post type schedule articles after an hour interval in between if any schedule articles was there need not to be published. I have created a cron schedule which is working in ...
Smith's user avatar
  • 1
2 votes
1 answer
38 views

Cron Register everytime if i reload admin if i pass some extra argument in wp_schedule_event function

Cron Register everytime if i reload admin if i pass some extra argument in wp_schedule_event function. Here you can check the scrrenshot I have checked the cron using the plugin WP Control. function ...
Prits's user avatar
  • 278
3 votes
0 answers
234 views

How to find code responsible for warnings from wp_cron runs?

I have a website created using wordpress, which is hosted on accuwebhosting.com Recently I have been getting emails with the subject line "Cron user@server cd wpfolder && /usr/local/bin/...
noravanq's user avatar
2 votes
2 answers
828 views

wp_schedule_single_event not working

I don't know why my scheduled cron events not working anymore, it used to before with the same code. I wrote a plugin that updates a CRM with the order note, if the communication fails I setup a ...
odedta's user avatar
  • 86
0 votes
0 answers
21 views

WordPress Cron Job not importing products

I think this issue is related to WordPres Cron System , because the function runs fine without cron but it doesn't work as expected when run via cron , please have a look : https://wordpress.org/...
rawaha johns's user avatar
0 votes
1 answer
325 views

What is the correct way to implement wp-cron server-side in Kubernetes?

I'm not sure if this is the correct place to ask the question, but since this is specific to deploying WordPress, I thought I'd ask here first. What is the correct way to implement wp-cron server-side ...
JakGuru's user avatar
0 votes
0 answers
65 views

How WP works with DB during cron job running?

I have to create script for daily import data from external source to WordPress website. It worked fine on my local machine. But when I run this import on wpengine, I get duplicate entries despite ...
levenyatko_o's user avatar
0 votes
0 answers
278 views

Protect wp-cron from hackers

I would like to get help on protecting wp-cron against hackers. Set up: Lightsail Bitnami Apache server, headless Wordpress CMS, frontend is on AWS Amplify. My wp-admin folder is protected with ...
David Simon's user avatar
0 votes
0 answers
40 views

Not getting expected email when running cron hook

I'm following the tutorial at https://wpshout.com/wp_schedule_event-examples/ I want to ensure my cron job works and is run at approximately a certain time of day. I have inserted debug code to send ...
StevieD's user avatar
  • 211
0 votes
1 answer
185 views

‘wp_site_health_scheduled_check’ Causes Failure Of Other Scripts

I introduced a heartbeat monitoring system on all my websites late last year. The system involves using a wp-cron action to send a GET request to an API hosted by Better Uptime, triggered by crontab ...
David Adams's user avatar
0 votes
0 answers
61 views

Running a function using Crown WordPress on one day a week, for example, Mondays of every week

Hello friends I am trying to write a plugin to be able to publish a post on a specific day. I need to be able to publish a specific text as a post on Mondays every week. The searches I did on the ...
Fardad Farhang's user avatar
1 vote
0 answers
66 views

Definition of page load for WP-Cron?

My site is extremely low traffic for the time being. For the sake of this question, let us assume it is no traffic. I have a .php file on my server which is executed every five minutes via crontab on ...
Dwest's user avatar
  • 11
0 votes
1 answer
77 views

HELP: Code To Check Status And Write Debug Entry

I use a simple function to send out a 'heartbeat' to a website uptime monitoring service (Better Uptime): function my_better_uptime_heartbeat() { wp_remote_get( 'https://betteruptime.com/api/v1/...
David Adams's user avatar
0 votes
1 answer
162 views

wp_schedule_event with dynamic names but same function

I am creating a plugin where I am getting records from the database and dynamically creating events with wp_schedule_event, some sample names: ls00_lorem ls00_john_doe ls00_jane_doe I am them ...
Ronald's user avatar
  • 43
0 votes
1 answer
189 views

WP CRON Fails At 13:00 Every Day

TL;DR; Advice please on troubleshooting this issue I have setup a real CRON scheduler (linux crontab) instead of relying on wp-cron scheduling - further info here. All it does is reliably initiate any ...
David Adams's user avatar
0 votes
1 answer
287 views

understanding wp_next_scheduled

I have a function that I've been attempting to get to work with wp_schedule_event. The function sends a notification to the admin. I see the event get added to the wp cron event list, but it never ...
Cody's user avatar
  • 1
1 vote
1 answer
1k views

Change a Post's Status based on the date from a custom field? (for Event posts)

I've found many posts on this topic and tried to use their solution, but none has worked so far... I have an Event custom post type with an event_end_date custom field. I'm trying to create a PHP ...
nomade0's user avatar
  • 27
0 votes
1 answer
227 views

Working function() doesn't execute when triggered by WP CRON

I've built the following before and have referenced my own code to see if I missed anything and from what I can tell I have not. I have a WP CRON scheduled and it executes as the scheduled intervals. ...
Tony Djukic's user avatar
  • 2,044
0 votes
0 answers
77 views

Update post meta with wp cron

I am trying to create a function (which I will trigger through the WP Cron) but no values are passed and the database values remain NULL. Could anyone point me in the right direction of where I'm ...
Rein's user avatar
  • 1
0 votes
0 answers
67 views

Error resetting database index using ALTER TABLE in $wpdb->query

I'm running a Cron job every hour that clears all posts of a particular CPT and then re-inserts data by accessing a third party API. I'm worried that this will lead to huge indexes, so I would like to ...
clayRay's user avatar
  • 135
1 vote
1 answer
226 views

Does DISABLE_WP_CRON prevent plugins from registering new cron tasks?

If I set DISABLE_WP_CRON to true in my wp-config.php file, then will it block plugins from registering new cron events (eg with calls to wp_schedule_event()) define( 'DISABLE_WP_CRON', true ); I've ...
Michael Altfield's user avatar
0 votes
0 answers
330 views

How to know if WP cron is currently running my hook?

I have an action that calls a function which takes about 20 seconds to complete (uploading file to remote server). How can I code it in such a way so that it could check if WP cron is running the same ...
ratib90486's user avatar
1 vote
0 answers
2k views

wp_privacy_delete_old_export_files, failed to run

The scheduled event, wp_privacy_delete_old_export_files, failed to run. Your site still works, but this may indicate that scheduling posts or automated updates may not work as intended.
Ashish's user avatar
  • 111
0 votes
1 answer
103 views

Cron event running more than once if triggered from WP Crontrol

This is just a sample plugin I created in order to track this issue down in a real plugin, but I am experience the same behavior: <?php // cron-test.php /** * Author: me * Description: CRON Test ...
Cyclonecode's user avatar
  • 1,154
2 votes
2 answers
1k views

Running one-off cron jobs when WP_DISABLE_CRON is true: can I hit /wp-cron.php?

I have a plugin that needs to do a "database update" sort of operation, going through all users and performing a particular database operation on each one. It's designed for sites with large ...
O. Jones's user avatar
  • 471
0 votes
1 answer
15 views

WordPress cron creation during plugin installation results with initial execution

I'm currently developing a plugin which uses WP cron. During the installation of the plugin, I'm creating 2 needed cron jobs with a timestamp of midnight -2 and a and midnight -1 hour, since job 2 ...
Johnny97's user avatar
  • 214
0 votes
0 answers
443 views

Wordpress cron job running more than once

I developed a plugin to read some XML files and publish their itens as post but for some reason, sometimes, it is duplicating posts. Basically that is what I have: // function one is scheduled (hourly)...
José Leonardo's user avatar
0 votes
1 answer
300 views

Scheduling an event inside plugin class is not working

wp_schedule_single_event is not firing. I wrote a function that is posting to external API, if it failed I schedule the same posting function to run 5 seconds later in cases of timeouts. Here's the ...
odedta's user avatar
  • 86
0 votes
1 answer
5k views

When running WordPress Cron manually, it shows WP-Cron spawning is disabled. What is WP-Cron spawning?

I use Ubuntu 20.04 LEMP stack VPS. In this server, I run 13 WordPress sites. Every 10 minutes I have set up to run each site cron job with a 20 seconds interval. So every site does not execute cron ...
Chathu's user avatar
  • 15
0 votes
1 answer
106 views

How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?

I created a custom plugin and I need to schedule add_action using Crontrol Plugin, the Setup class is from different php class. But the schedule action cant read the Crontrol even if I execute ...
JuniorA's user avatar
5 votes
0 answers
710 views

Is doing_wp_cron a necessary query string when scheduling cron.php as a cron job?

I have seen various ways to schedule the WordPress cron so that it is triggered by the server. Some will run the php file directory from the crontab and others will use a wget and reference the url. I ...
Mark Hunter's user avatar
0 votes
0 answers
217 views

Delete all posts with a specific custom field using meta_query

I'm building a listings website using WooCommerce. A listing is either set to live or sold inside of a custom field key status Once a listing is sold then the custom field status is updated with sold. ...
Sven Bjorksan's user avatar
0 votes
0 answers
62 views

Delete all users when they don't update profile_fields

I create a profile_fields named name, when users sign up for an account they will receive an email containing the nickname. When the user logs in, there will be a page to enter profile_fields (name), ...
minhte's user avatar
  • 1
0 votes
1 answer
161 views

Auto Delete Users (auto_delete_users)

I need some help cause I couldn't find any solution for my problem and haven't the knowledge to solve the problem on my own. What I'm trying to do: I want to delte every WordPress user (subscriber) ...
Still Ready's user avatar
0 votes
1 answer
35 views

Email alert with wp_cron and wp_mail if new data (external API) - Pseudo code

I would like to check twice daily if there is some new data published and send me an email if this is the case. In pseudo code here what I thought I could do: Get new list of movies (external API ...
C0G1T0's user avatar
  • 105

1
2 3 4 5
10