If you are getting notices that you aren’t optimally automating tasks, you have an opportunity to make your shop run better without doing much yourself!
Using a proper server-based cron job instead of relying solely on WP-Cron is essential for ensuring reliable and consistent performance in a WooCommerce store. WP-Cron, the built-in scheduling system in WordPress, is triggered only when a page on the site is loaded. This dependency means that if your site has low traffic, scheduled tasks like order processing, inventory updates, or email notifications may be delayed or missed entirely. Conversely, during high-traffic periods, WP-Cron can become overburdened, leading to performance issues or failed execution of critical tasks. A proper server cron, however, runs independently at predetermined intervals, ensuring that essential tasks execute on time regardless of site traffic.
Implementing a server cron also improves the overall efficiency and reliability of your store’s operations. Server crons are managed at the hosting level and operate on consistent intervals, making them better suited for tasks like syncing inventory with external systems, generating reports, or updating product feeds. This eliminates the unpredictability associated with WP-Cron and helps prevent missed or duplicate tasks. By switching to a server-based cron, shop owners can enhance the stability and responsiveness of their store, leading to a better customer experience and smoother backend operations.
How to set up proper cronjobs in WooCommerce
Unfortunately, this isn’t something easy you can fix in WordPress. You could try to log into your hosting providers Control Panel and look for a way to trigger a cronjob yourself. In that case the command you need to add looks like this:
*/5 * * * * cd /path/to/wordpress && wp cron event run --due-now
You could also always try to e-mail your hosting support team. Usually they’d be able to quickly help you with this. Here is an e-mail template with all the required information:
Dear [Hosting Provider’s Name or Support Team],
I hope this message finds you well. I am reaching out to request assistance with setting up a server-based cron job for my WordPress website hosted on your platform. The purpose of this cron job is to ensure timely execution of scheduled tasks by running the WordPress Cron system directly.
Here are the details for the cron job I would like to configure:
- Command:
cd /path/to/wordpress && wp cron event run --due-now
- Frequency: Every 5 minutes (*/5 * * * *)
Please let me know if additional details or permissions are required to set this up, or if I need to take any specific actions from my side. Your support in configuring this cron job would be greatly appreciated, as it is essential for the smooth functioning of scheduled tasks on my website.
Thank you in advance for your assistance! I look forward to your response.
Best regards,
Once a cronjob has been set up, you should add define( 'WP_CRON_DISABLED', true );
to your wp-config.php
file. This way, WordPress won’t try to run the cron itself.
Curious to see if your WooCommerce shop is running on a proper cron?
Install the free Shop Health plugin and instantly see if this is the case!