Setting up a cronjob
-
Hi there,
Is there any way to set up a cronjob for the autorun interval? Thanks!
-
We are using Action Scheulder (Tools -> Scheduled Actions), not WP Cron system.
Why would you like WP Cron instead of Action Scheduler? I can add such a setting if you want, but I just would like to know if the current way doesn’t work for you.
About scheduling: you can schedule a warming interval in Cache Warmer -> Settings -> Autorun IntervalI have no preference for WP Cron, I have some low traffic websites that I want to make sure have a warmed cache. There are some similar plugins that use a cronjob for this.
Perhaps a better question that I should’ve asked is how to make sure the action gets triggered on low traffic websites?
You could consider implementing a real cron job at the server level, which can call the WP-Cron system at regular intervals regardless of site traffic. This ensures that all scheduled tasks, including the Action Scheduler, are run as expected. This could be done through your hosting cPanel or equivalent or by setting up a cron job via command line if you have SSH access to your server.
Here is a sample command line cron job that hits the WP-Cron system every 12 hours:
0 */12 * * * wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Remember to replace “https://example.com” with your actual website URL. This will trigger WordPress’s cron system (which starts Action Scheduler) every 12 hours, ensuring that tasks are run even on low-traffic sites.
Action Scheduler used by this plugin is a robust scheduling library and is designed to work well even with lower traffic volumes. If your site gets at least a few hits per day, the Action Scheduler should operate without issue; it’s used by WooCommerce for example.
You can try it and let me know how it goes. If something is not working, I’m always here to help you.
Ah, yes, this works! Thank you!
I have one last question. I Use XML Sitemap & Google News to generate sitemaps, but whenever I use these sitemaps as entry points, it doesn’t warm the links included in them. It only warms the sitemap.xml URL and/or its child sitemaps URLs. No matter if I set depth to 1 or 9. Am I misunderstanding how this works?
Going back to my previous post, it seems to be something specific to this sitemap plugin, as it works perfectly fine using another plugin.
Hi @thomdj
Thank you very much for your feedback! I will investigate this.
I will respond to this topic when it’s solved.@thomdj Maybe you could give your website link in the meantime where you have this sitemaps plugin installed? I will check it out.
Hi, I already changed the sitemap plugin on this website, but the one I used was this one: XML Sitemap & Google News.
@thomdj Is it catching the sitemap now?
Yes, when using Rank Math sitemap, it is working as intended! 🙂
- The topic ‘Setting up a cronjob’ is closed to new replies.