WP Cron – A more reliable execution of scheduled posts and scripts

 

WordPress features and ‘pseudo’ cron function which loads at a certain interval when people visit your site. The Cron function is modeled after the linux/unix cron function which runs on most servers and check regularly for scheduled jobs to do.

The problem with the WordPress Cron is when nobody for a while visits your site. Or if you have a lot of heavy scheduled work to do this will slow down the user experience of your site.

There is a solution.

A lot of hosts support adding a cron job on the server, mostly through administration inferfaces like cPanel.

It’s easy. The only thing you have to do is add a crontab and a plugin called WP Cron Control. This plugin will provide you with a link you can use to add to your cron.

Note: Some examples in the links given will result in storing every automatic call you make to the servers hard drive, which is probably not what you want. This is the command I added to the cron:

1
15 * * * * wget -O - -q "URL to Cron script"

See more on developing with the WordPress cron here

A longer article on the in and outs of WordPress cron is available here

Tags: , , , ,


Bas Schuiling

Bas Schuiling

Expert on everything web development and WordPress. Is pressing his words when version 1 came out and has been liking it ever since. More than 10 years of work experience in web development and writer of this blog.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>