
By default, WordPress uses its built-in cron system, but it depends on user visits to trigger tasks. This can slow down your site and cause performance issues. A better approach is to use real server cronjobs to execute scheduled tasks efficiently.
Why You Should Use Real Server Cronjobs in WordPress
A cronjob is a scheduled task that runs at specific intervals. In Madara, cronjobs handle tasks like:
- Deleting temporary folders used when uploading chapters.
- Sending notifications to manga subscribers.
- Running web crawlers to collect data.
WordPress has its own wp-cron, but it runs only when a visitor loads a page. This can:
- Increase server load.
- Delay execution of critical tasks.
- Cause failures on low-traffic sites.
To avoid these issues, you should use real server cronjobs instead of WordPress’ default system.
How to Set Up Real Server Cronjobs for WordPress
Most hosting providers offer cronjob management tools like cPanel, Plesk, or WHM. Hereβs how to set up a real server cronjob:
Step 1: Access Cronjob Settings on Your Server
- Log in to your hosting control panel.
- Search for “Cronjobs” or “Scheduled Tasks”.
Step 2: Add a New Cronjob
In the command field, enter:
π Replace https://yourwebsite.com
with your actual domain.
Understanding the Cronjob Syntax
*/5 * * * *
β Runs every 5 minutes.* */2 * * *
β Runs every 2 hours.
Set the interval to match the smallest frequency of your scheduled tasks.
Step 3: Disable WordPress Default Cronjob
To prevent conflicts, disable WordPress’ built-in cron system by adding this line to wp-config.php
:
This ensures that WordPress no longer relies on user visits to execute tasks.
Benefits of Using Real Server Cronjobs
β
Reduces server load by eliminating unnecessary executions.
β
Ensures timely execution of scheduled tasks.
β
Improves site speed and performance.
β
Prevents delays in sending notifications or running crawlers.
By switching to real server cronjobs, you can enhance your WordPress site’s efficiency and avoid performance bottlenecks.