{"id":6999,"date":"2021-11-25T02:16:52","date_gmt":"2021-11-24T20:46:52","guid":{"rendered":"https:\/\/impulsebyte.com\/?p=6999"},"modified":"2025-11-20T18:16:09","modified_gmt":"2025-11-20T18:16:09","slug":"cron-job-crontab-wordpress-solution-speed-up-wordpress-website","status":"publish","type":"post","link":"https:\/\/impulsebyte.com\/blogs\/wordpress\/cron-job-crontab-wordpress-solution-speed-up-wordpress-website\/","title":{"rendered":"Cron Job &#8211; WordPress Solution &#8211; Speed Up WordPress website"},"content":{"rendered":"<p>We usually encounter with <a href=\"https:\/\/developer.wordpress.org\/plugins\/cron\/\" target=\"_blank\" rel=\"noopener\">Cron Job<\/a> and most of the people don&#8217;t know how much it can impact Speed of WordPress website if you did wrong with <a href=\"https:\/\/developer.wordpress.org\/plugins\/cron\/\" target=\"_blank\" rel=\"noopener\">Cronjobs<\/a>.<br \/>\nIn this blog we&#8217;ll discuss about how we can delete unwanted <a href=\"https:\/\/developer.wordpress.org\/plugins\/cron\/\" target=\"_blank\" rel=\"noopener\">crons<\/a> in correct manner from WordPress.<\/p>\n<h3><strong>Speed Up WordPress website by Cron job removal<\/strong><\/h3>\n<p>It made little difference for a small number of cron jobs that&#8217;s true but years into the life of a WordPress site one must bloated with hundreds if not thousands of old cron jobs from deleted plugins. Now, instead of suggesting to increase the php memory limit I would suggest that first check the number of cron jobs in wp_options when problem-solving fatal memory errors. It may be surprising if you find a lot of Cron Job.<\/p>\n<p>Here is a step-by-step method for deleting thousands of old cron jobs that I would like to share with everyone.<\/p>\n<ul>\n<li>Log into <a href=\"https:\/\/www.phpmyadmin.net\/\" target=\"_blank\" rel=\"noopener\">phpMyAdmin<\/a><\/li>\n<li>Select the used database and then the &#8216;search&#8217; tab.<\/li>\n<li>Type &#8216;cron&#8217; in search field then select &#8216;all tables&#8217; and clicked &#8216;Go&#8217;.<\/li>\n<li>Scroll down the search results list to my wp_options table.<\/li>\n<li>Now, click &#8216;Browse&#8217;.<\/li>\n<li>At the top of the list was option_name &#8216;cron&#8217;.<\/li>\n<li>Click &#8216;Edit&#8217; then wait for the page to load.<\/li>\n<li>Now, click on the box that show the list of cron jobs.<\/li>\n<li>The cron list was so long that it may take some time to respond.<\/li>\n<li>Select all crons using Ctrl-A on the keyboard before hitting the delete button.<\/li>\n<li>Again, It may take some time before browser complete the deletion<\/li>\n<\/ul>\n<h2><strong>Will it delete Cron job for active plugins?<\/strong><\/h2>\n<ul>\n<li>After another couple of minutes the cron jobs for current active plugins will re-populat the list.<\/li>\n<li>Also hundreds from common plugins such as Wordfence, BackupBuddy, Nextgen Gallery, and AutoOptimizer &#8211; all of which we generally use and if not useful then un-install as well.<\/li>\n<li>It should do the trick and your website now will loads like it&#8217;s been turbo-charged.<\/li>\n<\/ul>\n<p>It will load the admin area much quicker. Admin timeout errors have disappeared.<\/p>\n<h3><strong>What if I want it to fix via DB commands?<\/strong><\/h3>\n<p>First log into your database and then enter<\/p>\n<pre>SELECT * FROM `wp_options` WHERE option_name = 'cron'<\/pre>\n<p>If you find it you might try:<\/p>\n<pre>In SQL: UPDATE wp_options SET option_value = '' WHERE option_name = 'cron'\r\nIn wordpress: update_option('cron', '');<\/pre>\n<p>You might need to either delete the cron option or set the value to an empty serialized array.<\/p>\n<p>Using update_option would be safer as value should be a serialized empty array or an empty string. You could check in wp-includes\/options.php though &#8230; but using update_option will handle it properly without worrying about the database.<\/p>\n<h3><strong>Do it using WP-CLI<\/strong><\/h3>\n<p><a href=\"https:\/\/developer.wordpress.org\/plugins\/cron\/\" target=\"_blank\" rel=\"noopener\">WordPress cron events<\/a> can also be cleared from the command line, using <a href=\"http:\/\/wp-cli.org\/\" target=\"_blank\" rel=\"noopener\">WP-CLI<\/a><\/p>\n<pre>wp cron event list\r\nwp cron event delete your_example_event<\/pre>\n<p>More details in the <a href=\"https:\/\/wp-cli.org\/commands\/cron\/event\/delete\/\" target=\"_blank\" rel=\"noopener\">wp-cli docs<\/a>.<\/p>\n<p>wp option delete cron works when there are thousands of cron jobs stuffed in the options. These bad jobs comes mostly from bad plugins, doing cron the wrong way.<\/p>\n<p>One more way we can do this<\/p>\n<p>An even simpler solution is to call delete_option( &#8216;cron&#8217; ); once in some plugin. All automatically added cron jobs will get added again on the next visit\/request of your site.<\/p>\n<p>As a one case (mu) plugin that only runs whenever you activate it:<\/p>\n<pre>&lt;?php\r\n\/** Plugin Name: Clean Cron *\/\r\nregister_activation_hook( __FILE__, function()\r\n{\r\ndelete_option( 'cron' );\r\n} );<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>We usually encounter with Cron Job and most of the people don&#8217;t know how much it can impact Speed of WordPress website if you did wrong with Cronjobs. In this &hellip; <a title=\"Cron Job &#8211; WordPress Solution &#8211; Speed Up WordPress website\" class=\"hm-read-more\" href=\"https:\/\/impulsebyte.com\/blogs\/wordpress\/cron-job-crontab-wordpress-solution-speed-up-wordpress-website\/\"><span class=\"screen-reader-text\">Cron Job &#8211; WordPress Solution &#8211; Speed Up WordPress website<\/span>Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":7359,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37,106,114],"tags":[105,107,108,109,110,111,112,113],"class_list":["post-6999","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","category-cron-job","category-pageload-speed","tag-cron-job","tag-cron-job-acronym","tag-cron-job-every-month","tag-cron-job-expression","tag-cron-job-redhat","tag-cron-job-syntax-example","tag-cronjob","tag-pageload"],"_links":{"self":[{"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/posts\/6999","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/comments?post=6999"}],"version-history":[{"count":3,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/posts\/6999\/revisions"}],"predecessor-version":[{"id":7360,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/posts\/6999\/revisions\/7360"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/media\/7359"}],"wp:attachment":[{"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/media?parent=6999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/categories?post=6999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/impulsebyte.com\/blogs\/wp-json\/wp\/v2\/tags?post=6999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}