Articles of cron

Set a menu item to display during certain times

I have a “utility navigation” on the top of my website that currently has two links – one to our blog and the other to the weekly newsletter. We also do a radio show everyday at 5pm, as well as a rerun on Saturday at 7am and 7pm. During this time, I would like a […]

Create cron job without a plugin?

Basically I wrote a function that lets me change the post status to draft depending of a field in the postmeta table: /** * Remove ads if they have been sold for over 5 days */ function cp_remove_sold_ads(){ global $wpdb; // Get all sold ads $sold_ads = $wpdb->get_results(“SELECT * FROM ” . $wpdb->prefix . “postmeta […]

WP Super Cache All Pages

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!

Need to execute a cron job

I need a cron job to execute the following url The problem is that it requires to be logged in as admin, what are my options? I’ve tried a few plugins but they use hooks instead of just executing a url and the cron jobs provided by the control panel does not log in […]

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 looking to better control when cron jobs are triggered on each WordPress website. Is it possible to disable WordPress […]

WordPress Caching – Transients API or “update_user_meta ” Cronjob?

I’m trying to set user meta based on queries. Basically, things like IF the query returns true, set this or if not, set this (or don’t set it, if it is true). This works great but the problem is I currently make the call EVERTYIME to check true or false which I know is bad […]

Insert WordPress page via external (cron) script?

I’m trying to write a php script that I can run out of cron to create new WordPress pages. Unfortunately, I can’t find any documentation on how to do this. I’m using the WP scripts rather than directly manipulating the SQL…but still no joy. The below runs with no errors…but also produces no pages. I […]

Template Tag not available in real Cron Jobs

I have very simple file with one line: echo file_get_contents( get_template_directory_uri().’/scheduler.php’ ); This file is called by cpanel cron using php -q. When I put full link without get_template_directory_uri function everything works fine, with this function cron returns Call to undefined function get_template_directory_uri()

Web Scraping with Cron

I’m currently scraping prices from three websites using xPath, but since it updates on every page load, it makes loading slow. What I would like to do is store that data and only update it weekly. So: 1) Scrape prices from three different websites using xPath, 2) Store that data (and update it weekly with […]

Schedule event every second thursday of the month

I’m working on an email system and they want it automated to send out emails every second thursday of the month. I’ve got the PHP sorted out and ready to fire a callback to send the emails, but I’m a complete newbie when it comes to cron and scheduling events. Essentially, I have this: echo […]