{"id":16401,"date":"2025-09-15T14:53:24","date_gmt":"2025-09-15T12:53:24","guid":{"rendered":"https:\/\/surver.nl\/?post_type=kennisbank&#038;p=16401"},"modified":"2025-09-15T16:57:16","modified_gmt":"2025-09-15T14:57:16","slug":"disable-wp-cron","status":"publish","type":"kennisbank","link":"https:\/\/surver.nl\/en\/kennisbank\/disable-wp-cron\/","title":{"rendered":"Improve performance with Disable WP-Cron"},"content":{"rendered":"<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/surver.nl\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-15-sep-2025-14_56_37-1-1.png\" alt=\"\" class=\"wp-image-16804\" srcset=\"https:\/\/surver.nl\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-15-sep-2025-14_56_37-1-1.png 1024w, https:\/\/surver.nl\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-15-sep-2025-14_56_37-1-1-300x300.png 300w, https:\/\/surver.nl\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-15-sep-2025-14_56_37-1-1-150x150.png 150w, https:\/\/surver.nl\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-15-sep-2025-14_56_37-1-1-768x768.png 768w, https:\/\/surver.nl\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-15-sep-2025-14_56_37-1-1-12x12.png 12w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Many WordPress sites use the built-in scheduler WP-Cron by default. Handy on paper, but in practice this can cause slow load times or just missed tasks. Think of a blog post not going live on time, or a backup not running. Fortunately, you can easily fix this by disabling WP-Cron and replacing it with a real server-cron.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is WP-Cron and why can it cause problems?<\/h2>\n\n\n\n<p>WordPress has a built-in task scheduler called <strong>WP-Cron<\/strong>. Which ensures that scheduled tasks are performed automatically, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>publishing a scheduled blog post<\/li>\n\n\n\n<li>checking for updates to plugins or themes<\/li>\n\n\n\n<li>Running backups or maintenance tasks<\/li>\n<\/ul>\n\n\n\n<p>The difference with a \"real\" cron (like at the server level) is that WP-Cron does not run continuously. It is activated only as soon as someone visits a page of your website.<\/p>\n\n\n\n<p>That sounds convenient, but can cause two problems:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Little traffic?<\/strong> Then WP-Cron is not called often and scheduled tasks run late or not at all.<\/li>\n\n\n\n<li><strong>A lot of traffic?<\/strong> Then WP-Cron has to check every page load to see if anything needs to be done, which can slow down your site unnecessarily.<\/li>\n<\/ul>\n\n\n\n<p>For small sites with few scheduled tasks, the default is often fine. But once your site gets bigger or you want to make sure tasks always run on time, it's smarter to set up WP-Cron in a different way.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How do you disable WP-Cron and set up a system-cron?<\/h2>\n\n\n\n<p>By default, WordPress uses WP-Cron to handle scheduled tasks. The downside is that this happens only when someone visits your site. On small sites, this means that tasks sometimes run late, while on busy sites each page load causes extra server work.<\/p>\n\n\n\n<p>The solution is to disable WP-Cron on page load and run the tasks through a <em>system-cron<\/em> to run. A system cron is your server's task scheduler. It runs at fixed times that you set, independent of your visitors. This ensures that tasks always run on time and that your site responds faster.<\/p>\n\n\n\n<p>Below you will read step by step how to set it up.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Disable WP-Cron in wp-config.php<\/h3>\n\n\n\n<p>The first step is to adjust your <code>wp-config.php<\/code>. This file is in the <strong>root folder of your WordPress installation<\/strong>. You can find it via:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>SFTP or file management<\/strong> in your hosting panel \u2192 go to the folder where WordPress is installed (often <code>public_html<\/code> or the domain folder).<\/li>\n\n\n\n<li>In that folder you will see files such as <code>wp-config.php<\/code>, <code>wp-login.php<\/code> and the folders <code>wp-content<\/code>, <code>wp-admin<\/code>, <code>wp-includes<\/code>.<\/li>\n<\/ul>\n\n\n\n<p>Open <code>wp-config.php<\/code> with a text editor. Insert the following line <strong>just above<\/strong> the text <em>\"That's all, stop editing! Happy blogging.\"<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('DISABLE_WP_CRON', true);\n<\/code><\/pre>\n\n\n\n<p>From this point on, WP-Cron will no longer run on every page visit. You will soon be able to run the process via a cron job at set times, eliminating the extra load on your pages.<\/p>\n\n\n\n<p><strong>Need rollback?<\/strong><br>If you want to reset it to the default, delete this line or put in <code>\/\/<\/code> for. WordPress then automatically re-enables WP-Cron.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Schedule a cron job<\/h3>\n\n\n\n<p>Now that you have turned off WP-Cron in <code>wp-config.php<\/code>, there must be a <strong>replacement come to take over the work<\/strong>. That is a <em>cron-job<\/em>.<\/p>\n\n\n\n<p>You can think of a cron job as a <strong>alarm clock for your server<\/strong>: you agree to wake him up at set times to check if something needs to be done. For example: every 5 or 15 minutes. That way you can be sure that scheduled tasks such as newsletters, backups or blog posts always run on time, without depending on visitors to your site.<\/p>\n\n\n\n<p>Which method you use to set up that cron job depends on your hosting package:<\/p>\n\n\n\n<p>Have you <strong>An extended package or VPS with SSH access<\/strong> (often with managed or professional hosting)? \u2192 use <strong>CLI<\/strong>. This works more reliably because you are calling WP-Cron directly through the server, with no detours.<\/p>\n\n\n\n<p>Have you <strong>a standard hosting package without technical access to the server<\/strong> (usually with cheaper or shared hosting)? \u2192 use <strong>HTTP<\/strong>. That simply means that the server itself calls your site URL to activate WP-Cron.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Option A: HTTP (default in cPanel, suitable for almost everyone)<\/h4>\n\n\n\n<p>The most accessible way is via an HTTP call. In this, the server automatically visits the <code>wp-cron.php<\/code>-page of your site.<\/p>\n\n\n\n<p>This is how you set this up in Surver:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to your <strong>cPanel<\/strong>.<\/li>\n\n\n\n<li>Search under the heading <strong>Advanced<\/strong> to <strong>Cron Jobs<\/strong>.<\/li>\n\n\n\n<li>Click on <em>Add New Cron Job<\/em>.<\/li>\n\n\n\n<li>Set the interval, for example <strong>every 5 minutes<\/strong> (The \"Common Settings\" drop-down menu allows you to select this quickly).<\/li>\n\n\n\n<li>Fill in at <strong>Command<\/strong> the following in (replace <code>yourdomain.com<\/code> by your own domain):<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -q -O - \"https:\/\/jouwdomein.nl\/wp-cron.php?doing_wp_cron\" &gt;\/dev\/null 2&gt;&amp;1\n<\/code><\/pre>\n\n\n\n<p>Click on <em>Add New Cron Job<\/em>. From then on, your server runs the WP Cron every few minutes, even when there are no visitors.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Option B: WP-CLI (advanced, via SSH)<\/h4>\n\n\n\n<p>Do you have a package with <strong>SSH access<\/strong> and if you want maximum reliability, you can also set up the cron via WP-CLI. This goes outside HTTP and is less sensitive to caching or firewalls.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log via <strong>SSH<\/strong> in on your server (Surver can help you enable this).<\/li>\n\n\n\n<li>Open the cron tab with: <code>crontab -e<\/code><\/li>\n\n\n\n<li>Add a task, for example:<\/li>\n<\/ol>\n\n\n\n<p>With PHP:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*\/5 * * * * * * * cd \/home\/username\/public_html &amp;&amp; php -q wp-cron.php &gt;\/dev\/null 2&gt;&amp;1\n<\/code><\/pre>\n\n\n\n<p>With WP-CLI:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*\/5 * * * * * * * cd \/home\/username\/public_html &amp;&amp; wp cron event run --due-now &gt;\/dev\/null 2&gt;&amp;1\n<\/code><\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Save and exit. The cron job is now active.<\/li>\n<\/ol>\n\n\n\n<p><strong>Opinion:<\/strong> for most customers is <strong>Option A via cPanel<\/strong> more than enough. Only if you work with large web shops or heavy automations can <strong>Option B via WP-CLI<\/strong> provide more stability.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Choose the right interval<\/h3>\n\n\n\n<p>A cron job should run often enough to handle all tasks in a timely manner, but also not so often as to unnecessarily load the server. For most WordPress sites, an interval of <strong>every 5 to 15 minutes<\/strong> fine.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>5 minutes<\/strong>: suitable for sites with many scheduled tasks, such as large web shops or sites with a lot of automation.<\/li>\n\n\n\n<li><strong>15 minutes<\/strong>: sufficient for blogs, business sites and smaller web shops.<\/li>\n\n\n\n<li><strong>Shorter than 5 minutes<\/strong>: needed only for very specific use cases (e.g. critical API syncs).<\/li>\n<\/ul>\n\n\n\n<p>Many managed hosting parties default to 15 minutes. Adjust this only if you notice that tasks are falling behind.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Checking that everything is running<\/h3>\n\n\n\n<p>Once you have set up a cron job, it is important to check that WP-Cron is actually running properly. You can do that with a few simple commands via WP-CLI.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Test the spawner:<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>wp cron test\n<\/code><\/pre>\n\n\n\n<p>If you get the message <em>\"WP-Cron spawning is working as expected\"<\/em>, you know the basics are right.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>View scheduled events:<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>wp cron event list\n<\/code><\/pre>\n\n\n\n<p>Pay particular attention to the columns <em>Next Run<\/em> and <em>Recurrence<\/em> to see when the next task is scheduled.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Turn off overdue tasks immediately:<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>wp cron event run --due-now\n<\/code><\/pre>\n\n\n\n<p>Useful for checking that all processes are working cleanly or to clear backlogs immediately.<\/p>\n\n\n\n<p>With these three checks, you can quickly see if your cron is set up properly and if your scheduled tasks are actually running.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting for problems<\/h2>\n\n\n\n<p>Is your cron job not working as expected? Here are the most common causes and solutions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Tasks run late or not<\/strong><br>First, check that the cron job is really running. For HTTP cron, you can look in the server logs to see if <code>wp-cron.php<\/code> is called. WP-CLI allows you to force backlogged tasks with: <code>wp cron event run --due-now<\/code><\/li>\n\n\n\n<li><strong>HTTP cron does not work<\/strong><br>Often caching, a firewall or Basic Auth blocks the call. Then try the CLI method, which bypasses such layers.<\/li>\n\n\n\n<li><strong>You see <code>?doing_wp_cron<\/code> in URLs<\/strong><br>This is a normal side effect of HTTP triggers. If you don't want this, choose the CLI variant.<\/li>\n\n\n\n<li><strong>Multisite or managed hosting<\/strong><br>Some hosting parties already have server-cron set up. Disable WP-Cron only if you are sure an alternative is active.<\/li>\n\n\n\n<li><strong>Security considerations<\/strong><br>Late <code>wp-cron.php<\/code> not unlimited public access. With CLI and WP-CLI, you limit the attack surface and have more control.<\/li>\n<\/ul>\n\n\n\n<p>With these checks, you'll solve most problems right away. If things keep going wrong, it is wise to consult with your hosting party - often they already offer a standard solution.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Checklist &amp; best practices<\/h2>\n\n\n\n<p>Finally, the short summary to set up your WP-Cron securely and reliably:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Turn off WP-Cron in <code>wp-config.php<\/code> with <code>define('DISABLE_WP_CRON', true);<\/code><\/li>\n\n\n\n<li>Schedule a system cron, preferably via CLI or WP-CLI.<\/li>\n\n\n\n<li>Use an interval of 5 to 15 minutes, depending on your site.<\/li>\n\n\n\n<li>Check the operation with <code>wp cron test<\/code> and <code>wp cron event list<\/code>.<\/li>\n\n\n\n<li>Solve overdue tasks with <code>wp cron event run --due-now<\/code>.<\/li>\n\n\n\n<li>Avoid HTTP triggers like caching, firewalls or Basic Auth throwing a spanner in the works.<\/li>\n<\/ul>\n\n\n\n<p>By disabling WP-Cron and using a real cron job, scheduled tasks are always executed on time without slowing down your load times.<\/p>\n\n\n\n<p>Would you rather have this type of optimization professionally set up? At <a href=\"https:\/\/surver.nl\/en\/services\/wordpress-optimization\/\">Surver's WordPress optimization<\/a> we make sure your site is technically tight and performing optimally, so you can focus on your business.<\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Veel WordPress-sites gebruiken standaard de ingebouwde planner WP-Cron. Handig op papier, maar in de praktijk kan dit zorgen voor trage laadtijden of juist gemiste taken. Denk aan een blogbericht dat niet op tijd live gaat, of een back-up die niet draait. Gelukkig kun je dit eenvoudig oplossen door WP-Cron uit te schakelen en te vervangen [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":16804,"template":"","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}}},"kennisbank_categorieen":[62],"class_list":["post-16401","kennisbank","type-kennisbank","status-publish","has-post-thumbnail","hentry","kennisbank_categorieen-wordpress"],"acf":[],"_links":{"self":[{"href":"https:\/\/surver.nl\/en\/wp-json\/wp\/v2\/kennisbank\/16401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/surver.nl\/en\/wp-json\/wp\/v2\/kennisbank"}],"about":[{"href":"https:\/\/surver.nl\/en\/wp-json\/wp\/v2\/types\/kennisbank"}],"author":[{"embeddable":true,"href":"https:\/\/surver.nl\/en\/wp-json\/wp\/v2\/users\/2"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/surver.nl\/en\/wp-json\/wp\/v2\/media\/16804"}],"wp:attachment":[{"href":"https:\/\/surver.nl\/en\/wp-json\/wp\/v2\/media?parent=16401"}],"wp:term":[{"taxonomy":"kennisbank_categorieen","embeddable":true,"href":"https:\/\/surver.nl\/en\/wp-json\/wp\/v2\/kennisbank_categorieen?post=16401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}