{"id":851,"date":"2018-02-28T10:10:26","date_gmt":"2018-02-28T04:40:26","guid":{"rendered":"https:\/\/www.coimbatorewebhosting.com\/blog\/?p=851"},"modified":"2018-02-27T12:17:50","modified_gmt":"2018-02-27T06:47:50","slug":"how-to-disable-wp-cron-php-in-wordpress","status":"publish","type":"post","link":"https:\/\/coimbatorewebhosting.com\/blog\/how-to-disable-wp-cron-php-in-wordpress\/","title":{"rendered":"How to disable wp-cron.php in wordpress"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/coimbatorewebhosting.com\/blog\/how-to-disable-wp-cron-php-in-wordpress\/#About_Cron\" >About Cron:-<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/coimbatorewebhosting.com\/blog\/how-to-disable-wp-cron-php-in-wordpress\/#Drawbacks_of_wp-cronphp_to_run_cron_job\" >Drawbacks of&nbsp;wp-cron.php to run cron job:-<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/coimbatorewebhosting.com\/blog\/how-to-disable-wp-cron-php-in-wordpress\/#Steps_to_disable_the_wp-cronphp\" >Steps to disable the wp-cron.php:-<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/coimbatorewebhosting.com\/blog\/how-to-disable-wp-cron-php-in-wordpress\/#Setup_cron_job_for_wp-cronphp_manually\" >Setup cron job for wp-cron.php manually<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"About_Cron\"><\/span>About Cron:-<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A cron job is a task that can automatically run or schedule to run at some specific intervals.Say if you need to take backup for periodically than you will run the cron job.<\/p>\n<p>In its default config, WordPress does not use a real cron job for scheduling and other related tasks.<\/p>\n<p>Instead, whenever a page is loaded on a WordPress site, WordPress runs the&nbsp;<em>wp-cron.php<\/em>&nbsp;file.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Drawbacks_of_wp-cronphp_to_run_cron_job\"><\/span>Drawbacks of&nbsp;<em>wp-cron.php <\/em>to run cron job:-<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>while we run the&nbsp;<em>wp-cron.php&nbsp;<\/em> every time the word press loads a page it is unnecessary due to this it will affect the server performance,in the sites it will receive a lot of traffic.<\/p>\n<p>To resolve these issues, you can disable the default virtual WordPress cron job, and configure a real cron job<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Steps_to_disable_the_wp-cronphp\"><\/span>Steps to disable the wp-cron.php:-<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To disable the default virtual WordPress cron job, follow the below steps,<\/p>\n<p>1.open the&nbsp;wp-config.php file via file manager or ftp.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-852\" src=\"https:\/\/www.coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-wp.jpg\" alt=\"\" width=\"1338\" height=\"660\" srcset=\"https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-wp.jpg 1338w, https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-wp-300x148.jpg 300w, https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-wp-768x379.jpg 768w, https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-wp-1024x505.jpg 1024w\" sizes=\"auto, (max-width: 1338px) 100vw, 1338px\" \/><\/p>\n<p>2. Edit the file<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-853\" src=\"https:\/\/www.coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-1.jpg\" alt=\"\" width=\"520\" height=\"358\" srcset=\"https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-1.jpg 520w, https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-1-300x207.jpg 300w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/p>\n<p>3.Identify the following line:<\/p>\n<p>\/** The Database Collate type. Don\u2019t change this if in doubt. *\/<br \/>\ndefine(\u2018DB_COLLATE\u2019, \u201d);<\/p>\n<pre>\/** The Database Collate type. Don\u2019t change this if in doubt. *\/\r\ndefine(\u2018DB_COLLATE\u2019, \u201d);\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>4. Next add the following script<\/p>\n<pre>define('DISABLE_WP_CRON', 'true'); \r\n<\/pre>\n<pre>\/** The Database Collate type. Don\u2019t change this if in doubt. *\/\r\ndefine(\u2018DB_COLLATE\u2019, \u201d);\r\ndefine('DISABLE_WP_CRON', 'true');<\/pre>\n<p>5. save all the above changes.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Setup_cron_job_for_wp-cronphp_manually\"><\/span>Setup cron job for wp-cron.php manually<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Step 1. Access cronjob through cPanel or SSH.<\/p>\n<p>Step 2. For cPanel, click the drop-down menu for&nbsp;Common Settings and select once per hour.<\/p>\n<p>Step 3. Enter the following&nbsp;command in the Command field:<\/p>\n<pre>cd \/home\/cpanelusername\/public_html; php -q wp-cron.php<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-854\" src=\"https:\/\/www.coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-2.jpg\" alt=\"\" width=\"683\" height=\"281\" srcset=\"https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-2.jpg 683w, https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-2-300x123.jpg 300w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><\/p>\n<p>Step 4. Click Add New Cron Job button.<\/p>\n<p>Step 5. The cron job is now added in your cPanel.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-855\" src=\"https:\/\/www.coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-3.jpg\" alt=\"\" width=\"1246\" height=\"174\" srcset=\"https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-3.jpg 1246w, https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-3-300x42.jpg 300w, https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-3-768x107.jpg 768w, https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/cron-job-3-1024x143.jpg 1024w\" sizes=\"auto, (max-width: 1246px) 100vw, 1246px\" \/><\/p>\n<p>Thats all! i think this post will helpfull for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>About Cron:- A cron job is a task that can automatically run or schedule to run at some specific intervals.Say if you need to take backup for periodically than you will run the cron job. In its default config, WordPress does not use a real cron job for scheduling and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":859,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-851","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-latest"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/02\/wp-cron.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pa2YU7-dJ","_links":{"self":[{"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/comments?post=851"}],"version-history":[{"count":0,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/851\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/media\/859"}],"wp:attachment":[{"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/media?parent=851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/categories?post=851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/tags?post=851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}