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
1 answer
24 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
19 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
  • 113
0 votes
0 answers
27 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
24 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
14 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
16 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
29 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
169 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
352 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
  • 76
0 votes
0 answers
19 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
159 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
53 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
74 views

wp cron does not run when i am not logged in to wp admin

I create a cronjob with my plugin but it is very very strange when I am not logged in to wp admin dashboard the cronjob is not running and when i am not logged in to wp admin dashboard it is running ...
Usman Khan's user avatar
0 votes
0 answers
18 views

Custom cronjob not executing at all, but manually

In my themes function.php, I've added that code to load a custom code based on the cron: add_action( 'wp', 'schedule_test_cron' ); function schedule_test_cron() { if ( !wp_next_scheduled( 'test_cron'...
John_H_Smith's user avatar
0 votes
0 answers
158 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
33 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
0 answers
36 views

Background Tasks in a WP Cronjob?

I have specific tasks which I want to perform every 15s in the background to update some cache / transients. I already use an external Cronjob service that triggers the Cron runs in WP - but ...
tim's user avatar
  • 154
0 votes
1 answer
123 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
8 views

Multiple conditional logic in Custom Event In WP_ Cron not working

Im new on cron and I want to update a custom field every 5 mins and my code only works once and it doesn't continue on elseif. please help function bf_do_something_on_schedule() { global $post; ...
Eunice's user avatar
  • 13
0 votes
0 answers
27 views

Update last created post in custom post types with wp_cron()?

I have a question about wordpress cron job. I have created a website using elementor page builder. I made a form for client which my client used to send invoices to their clients. Once my client ...
The Adobe Teacher's user avatar
0 votes
0 answers
47 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
59 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
61 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
96 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
  • 23
0 votes
0 answers
198 views

Error code 499 on specific cron job

I am getting error code 499 in my website's access logs. The site is built with WordPress. The logs are mostly coming from bg.googleusercontent.com which is I think google's analytics tool or some ...
aslamdoctor's user avatar
0 votes
0 answers
66 views

How to Auto Update Wordpress Post after specific time?

I hope you all are doing well. I need some help to update my post automatically after 1 year. I read alot of articles and hope this can be achive using wp-cron-jobs. Problem Explanation: Here are my ...
Developer Mohsin's user avatar
0 votes
1 answer
139 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
193 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
679 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
114 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
  • 1,958
0 votes
0 answers
64 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
55 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
144 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
287 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
1k 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
72 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,144
2 votes
2 answers
782 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
12 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
354 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
241 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
  • 76
0 votes
1 answer
4k 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
72 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
4 votes
0 answers
597 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
198 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
58 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
93 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
32 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
0 votes
1 answer
196 views

How to run wp_insert_post() & wpdb on the background?

I have created a code to fetch data from a remote API then echo certain data & import those data into a post type using wp_insert_post() & post meta** using wpdb->query(). Here's my current ...
Amenadiel's user avatar
0 votes
1 answer
150 views

WP Cron scheduling doesn't work reliably on hosted server

The following code is part of a save_post action. It works as expected in my local dev environment, but doesn't work reliably on a hosted server. (By unreliably I mean it sometimes work, but without ...
noos's user avatar
  • 1

1
2 3 4 5
10