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

learn more… | top users | synonyms

3
votes
1answer
535 views

Change post status based on meta value

I have this cron set up to trash posts x days after it is posted. This works. Edit: Added my answer to my question. add_action( 'wp', 'do_trash_ads' ); function do_trash_ads() { if ( ! ...
0
votes
1answer
11 views

How do I routinely extract the thumbnail of the most recent post?

I would like to write a PHP snippet that can communicate with Wordpress. When a new post is published, a file today.jpg will be generated from the thumbnail url (a custom field) of the most recent ...
0
votes
1answer
19 views

Scheduling posts in database

I have more than 100 posts to schedule. I have set the date and the status (future) with a SQL query. But when the time comes the post is not published and in desktop I can read message 'Schedule ...
0
votes
0answers
20 views

How to create a WP Cron hooks based on schedules from Advanced cron manager plugin?

I need to run the following script once per 24 hours: (1) http:domain.com/wp-cron.php?import_key=Iq_GCn7v0&import_id=36&action=trigger the following one to run after the above, once or twice ...
0
votes
1answer
512 views

wp-cron: freeze at “now”

sorry for the silly question. Briefly I have a wp (v. 3.5.1) blog using a heavily modified (by myself) theme. Everything works fine except for wp-cron. Listed jobs appears in (for instance) crontrol ...
0
votes
1answer
596 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
1answer
440 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 ...
5
votes
1answer
169 views

wp_schedule_event() on specific time, daily

I'm not well verse with WP Cron, but I used them in one of my site knowledgeably. I set a custom query for every hour: add_action( 'init', function () { if( ! wp_next_scheduled( 'expire_cpt' ) ) ...
2
votes
1answer
2k views

Scheduled posting not working

I have Wordpress 3.5.1 and I use Bluehost hosting service. When I schedule posts after that time passed, WP posts dashboard shows "Missed schedule" message under the date. Then I checked my ...
1
vote
3answers
369 views

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 ...
0
votes
1answer
27 views

WP Cron being triggered but not working as expected

I have created a WP cron job, my code for the cron job is shown below: public function run_import(){ if ( isset($_POST["run_import"])) { add_action( 'import_execution_event_test', ...
2
votes
1answer
984 views

wp_schedule_event in a class

This is my (stripped down) plugin, in OOP: <?php /* Plugin Name: Cron Test Plugin URI: http://www.mywebsite.com/ Description: Test Version: 1.0 Requires at least: 3.0 */ class CronTest { public ...
3
votes
2answers
62 views

WP Schedule Event - Every Day When First Visitor Comes

I have a daily wp schedule event. I know that it happens when a user visits the site and if a schedule time passes. If I started it on today 12 a.m. and if tomorrow first visitor comes tomorrow ...
0
votes
0answers
27 views

Set up a wp_cron to work daily, and set up a real cpanel chron, but its not working

So I followed all the instructions on this page https://support.hostgator.com/articles/specialized-help/technical/wordpress/how-to-replace-wordpress-cron-with-a-real-cron-job disabled wp_cron, and ...
0
votes
1answer
38 views

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 ...
0
votes
1answer
24 views

Schedule Removal of Menu Page and Shortcode

I want to schedule removal of a menu page and shortcode from wordpress after a certain time period. I am using below code but neither shortcode nor menu gets removed after a time period. Below is my ...
0
votes
0answers
30 views

WordPress Scheduled Task Not Firing

I want to echo a string after a time period using WordPress scheduling. Below is my code in functions.php. Nothing gets printed through echo statement and also there is no error. Please guide what am ...
0
votes
1answer
45 views

WordPress: Cron locking and Queue

I have some CPU intensive scripts that I don't want to run concurrently. Every now and again the scripts will overlap and crash the server. Already at 2GB and the mysql container still crashes. I ...
0
votes
1answer
271 views

How to avoid timeout waiting for output from CGI script?

I have Apache Error coming from /wp-cron.php. I didn't modify that file. How can I avoid the timeout?
1
vote
1answer
32 views

Cron While Editing Post

I have a multi-author blog, on which there are two schedule cron functions. The first function moves all public posts in the pending status after 365 days: if( ! wp_next_scheduled( ...
1
vote
1answer
21 views

How to periodically scrape and cache strings from remote txt files. - My First Plugin

I maintain a resource website, FilterLists, which is essentially a directory of txt files hosted around the net. I am trying to build my first WordPress plugin to (a) learn and (b) add a new feature ...
0
votes
0answers
17 views

flush_rewrite_rules with wp_cron

I'm trying to build myself a plugin for remote viewing data of all my WordPress installations in one overview. Therefore I'm generating a list using xmlrpc to remote connect to all the WordPress ...
0
votes
0answers
17 views

How to have a cron execute at a certain time on a certain day of the week

What's the best way to set a WP cron to fire once every Friday at 7PM EST? I know I could do something like the following, but if I understand correctly it will fire once right away, then reschedule a ...
0
votes
5answers
825 views

How to run a function every 5 minutes?

I have a function to be run every 5 minutes. I've referred following from the codex: <?php wp_schedule_event(time(), 'hourly', 'my_schedule_hook', $args); ?> I want to run this function just ...
3
votes
1answer
96 views

Wordpress cron isn't scheduled on amazon web services

I'm trying to setup a cron to run every hour, it works fine on my local vagrant box, but it doesn't seem to schedule properly on aws(elastic beanstalk). Here's the code: ...
0
votes
0answers
58 views

How Can I lock function to prevent running multiple instances in one time?

I have written a plugin. There's a function int it that works with a DB table and (works on a data tree) ,I want if function starts running ,other instances lock until it finishes(then other instance ...
0
votes
1answer
18 views

wp-cron function not running when activating the cron by form submit

I'm activating the cron by a form submit button ( not when plugin is activated ). Thus users have choice to set the cron or not. But it doesn't trigger the function. The cron is set, but triggering ...
9
votes
5answers
10k views

Converting timestamps to local time with date_l18n()

I've got a WordPress cron job that sends an email periodically and saves the timestamp when it was sent as an option, and I'd like to display a date on a settings page. Something like, "The last ...
0
votes
2answers
43 views

Wordpress cron is running with previously set time intervals and not the updated one

For testing purposes I keep short time intervals for cron and when the functionality is working fine, I change it to the required time interval. Whenever I change the time intervals for ex: from ...
3
votes
2answers
1k 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 ...
1
vote
0answers
32 views

Cron job not working - Can't see in the queue attached

I have a custom schedule defined for a cron job to be triggered. This is how my code looks: <?php //wp-config define('DISABLE_WP_CRON', true); //Plugin file register_activation_hook( '__FILE__', ...
1
vote
1answer
20 views

How to disable wordpress cron jobs for a subsite?

Is there a way to disable the execution of all the cron jobs of a particular subsite in a wordpress multisite installation?
1
vote
2answers
105 views

Run function with linux cron job in Wordpress

I know that WordPress has a faux cron that is called like so when a user visits the page. register_activation_hook(__FILE__, 'my_activation'); add_action('my_hourly_event', 'do_this_hourly'); ...
0
votes
0answers
17 views

How to Solve the Wordpress Cron Job Site Slow down Problem?

The Cron job has more data's which creates entry everytime when a page is loaded. So i tried to get a solution by searching about it. I got some clarifications. But no solution for my problem. Many ...
0
votes
1answer
40 views

Too many wp-cron requests even when disabled

We have a webserver with a number of wordpress instances. Most if not all of them have disabled wp-cron.php using the wp-config line define('DISABLE_WP_CRON',true); Despite this, there are more ...
0
votes
1answer
31 views

WP Cron not executing after timespan

I trying to utilize wp_schedule_single_event to schedule an asynchronous task. However, my event was never called after 60 seconds. Do I need to do anything with ldp_new_topic_event hook before using ...
0
votes
1answer
59 views

Sending emails to separate accounts using a for loop

I need to run a for loop to go through all the users on my site and send any that are applicable an email. A user can have several categories on their profile, let's say 4. If the customer has ...
0
votes
0answers
26 views

How to add Cron to WordPress

I trying to develop a plugin to send emails to users in a specific time, so I have created my plugin like that : register_activation_hook(__FILE__, 'my_activation'); add_action('my_hourly_event', ...
0
votes
1answer
76 views

WP Cron as Fast as WordPress AJAX?

I have a question about performing a very long and resource intensive task within WordPress. Here is the scenario. I have a plugin that allows users to run a task that takes a very long time and ...
3
votes
2answers
189 views

Wordpress scheduled task is called but not executed

I created a plugin with a cron to update all posts of a certain type every 5 minutes. I installed WP Crontrol to check if the cron is registered correctly and everything seems to be okay. This is how ...
6
votes
3answers
619 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
26 views

How to setup a mail list with 2 hour autoresponder?

I have a WordPress blog and I want to put my product behind a subscribe list sign up. Here are my requirements: Need subscribe list to work with WordPress or Dreamhost (my hosting company is ...
1
vote
4answers
103 views

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, ...
3
votes
1answer
144 views

Multiple wp_schedule_event cron jobs in plugin cause multi-execution

over the last week I have been working on some cron jobs for a real-estate website that has hundreds of updates/deletes and new posts added each day. I am very near the end now and looking to ...
0
votes
1answer
80 views

daily job to run send email based on user data

Quick setup/info: A user can login to my site and is presented with a form to complete. The form contains a Category drop down, and then 5 possible text fields with a Task Name and a Completion Date ...
0
votes
0answers
22 views

How to email a published post notification at a certain time?

I am using follwoing code to send an email if any post is published or draft to published. <?php add_action('future_to_publish', 'send_emails_on_new_event'); add_action('new_to_publish', ...
0
votes
0answers
46 views

WP_cron not updating post meta, instead clearing it

I'm trying to store social media follower count (ex. FB fans, Twitter followers) in post meta daily with wp_cron. If I manually save the post it will save the social media count numbers correctly in ...
0
votes
0answers
2k 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
54 views

couldn't connect to host - wp-cron.php?doing_wp_cron

I've moved my wordpress website to new dedicated server. Website is running few cron jobs setup by wp-cron. As soon as i moved the website to new server cron jobs stopped running. I've debug bar ...
1
vote
0answers
24 views

Can you register two cron events in a single function?

Take the following: public static function activate() { wp_schedule_event( time(), 'twicedaily', 'process_rss_items' ); wp_schedule_event( time(), 'minute_15', 'process_top_news' ); } // end ...