{"id":3346,"date":"2016-01-08T06:45:36","date_gmt":"2016-01-08T06:45:36","guid":{"rendered":"https:\/\/cpanelplesk.com\/wp62\/?p=3346"},"modified":"2021-02-06T10:34:52","modified_gmt":"2021-02-06T10:34:52","slug":"replace-wordpress-cron-with-a-real-cronjob","status":"publish","type":"post","link":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/","title":{"rendered":"Replace wordpress cron with a real cronjob"},"content":{"rendered":"<p>WordPress comes with its own cron job that allows you to schedule your posts and events., WordPress cron is a system that has a set of tasks, each with a time when it needs to be executed.<!--more--><\/p>\n<p>However, in some cases, wp-cron.php file in your main WordPress may become target of a DOS attack, or caching plugins can interfere with its execution which can cause a lot of server load and as a result the cron can not execute properly and timely. That&#8217;s why, you can alternate this file constant execution with a real <a href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-crontab-in-centosrhel-765\/\">cron job.<\/a><\/p>\n<p>Replacing your WordPress cron job with a server cron job can be beneficial in many ways.By using a real cron job,You can be sure that all your schedule tasks are executed \u00a0It can eliminate high CPU usage caused by WordPress.\u00a0For blogs with high traffic, using a real <a href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-view-the-various-cron-jobs-running-in-the-server\/\">cron job<\/a> can also reduce the server bandwidth and reduce the chances of your server crashing.<\/p>\n<p>To configure a real cron job\u00a0First, You need to disable the WordPress cron job by opening your <strong>wp-confg.php<\/strong>\u00a0file and add this line at the end, before the closing <strong>?&gt;<\/strong>tag:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">define('DISABLE_WP_CRON', true);<\/pre>\n<\/div>\n<p>Once done , you need to setup a real <a href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-check-if-a-cron-job-has-ran\/\">cron job<\/a> and execute this file with it.<\/p>\n<p>Log into your cPanel.<\/p>\n<p>Scroll down the list of applications until you see the \u201c<em>cron jobs<\/em>\u201d link. Click on it.<\/p>\n<p>Then, add the following command to be executed every 30 minutes:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">\/usr\/local\/bin\/php \/home\/user\/public_html\/wp-cron.php<\/pre>\n<\/div>\n<p>Or you can also use wget as an alternate:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">wget -q -O - http:\/\/yourwebsite.com\/wp-cron.php?doing_wp_cron &gt;\/dev\/null 2&gt;&amp;1<\/pre>\n<\/div>\n<p>You need to replace <strong>\/user\/<\/strong> with your actual cPanel username. The Cron jobs tool has some of the most common schedules preset, so you can just select Every 30 minutes from the minutes drop-down and place a * symbol in the others.<\/p>\n<p>That\u2019s it.<\/p>\n<p>If you want you can also\u00a0set an email to receive the output of your cronjob, to make sure that the task is executing properly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress comes with its own cron job that allows you to schedule your posts and events., WordPress cron is a system that has a set of tasks, each with a time when it needs to be executed. [&#8230;]<\/p>\n<p><a class=\"understrap-read-more-link\" href=\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3349,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,13],"tags":[],"class_list":["post-3346","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","category-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Replace wordpress cron with a real cronjob - cPanel Plesk<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Replace wordpress cron with a real cronjob - cPanel Plesk\" \/>\n<meta name=\"twitter:description\" content=\"WordPress comes with its own cron job that allows you to schedule your posts and events., WordPress cron is a system that has a set of tasks, each with a time when it needs to be executed. [...]Continue Reading...\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/01\/cronjob-1-e1452235527402.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Farooq Omer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/\"},\"author\":{\"name\":\"Farooq Omer\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"headline\":\"Replace wordpress cron with a real cronjob\",\"datePublished\":\"2016-01-08T06:45:36+00:00\",\"dateModified\":\"2021-02-06T10:34:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/\"},\"wordCount\":327,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"image\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/01\/cronjob-1-e1452235527402.jpg\",\"articleSection\":[\"Cpanel\",\"WordPress\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/\",\"name\":\"Replace wordpress cron with a real cronjob - cPanel Plesk\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/01\/cronjob-1-e1452235527402.jpg\",\"datePublished\":\"2016-01-08T06:45:36+00:00\",\"dateModified\":\"2021-02-06T10:34:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#primaryimage\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/01\/cronjob-1-e1452235527402.jpg\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/01\/cronjob-1-e1452235527402.jpg\",\"width\":200,\"height\":200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cpanelplesk.com\/wp62\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Replace wordpress cron with a real cronjob\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/\",\"name\":\"cPanel Plesk\",\"description\":\"Blog on famous hosting control panels\",\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\",\"name\":\"Farooq Omer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"width\":300,\"height\":44,\"caption\":\"Farooq Omer\"},\"logo\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/cpanelplesk.com\/wp62\/author\/fokado\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Replace wordpress cron with a real cronjob - cPanel Plesk","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/","twitter_card":"summary_large_image","twitter_title":"Replace wordpress cron with a real cronjob - cPanel Plesk","twitter_description":"WordPress comes with its own cron job that allows you to schedule your posts and events., WordPress cron is a system that has a set of tasks, each with a time when it needs to be executed. [...]Continue Reading...","twitter_image":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/01\/cronjob-1-e1452235527402.jpg","twitter_misc":{"Written by":"Farooq Omer","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#article","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/"},"author":{"name":"Farooq Omer","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"headline":"Replace wordpress cron with a real cronjob","datePublished":"2016-01-08T06:45:36+00:00","dateModified":"2021-02-06T10:34:52+00:00","mainEntityOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/"},"wordCount":327,"commentCount":1,"publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"image":{"@id":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#primaryimage"},"thumbnailUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/01\/cronjob-1-e1452235527402.jpg","articleSection":["Cpanel","WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/","url":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/","name":"Replace wordpress cron with a real cronjob - cPanel Plesk","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#primaryimage"},"image":{"@id":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#primaryimage"},"thumbnailUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/01\/cronjob-1-e1452235527402.jpg","datePublished":"2016-01-08T06:45:36+00:00","dateModified":"2021-02-06T10:34:52+00:00","breadcrumb":{"@id":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#primaryimage","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/01\/cronjob-1-e1452235527402.jpg","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2016\/01\/cronjob-1-e1452235527402.jpg","width":200,"height":200},{"@type":"BreadcrumbList","@id":"https:\/\/cpanelplesk.com\/wp62\/replace-wordpress-cron-with-a-real-cronjob\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cpanelplesk.com\/wp62\/"},{"@type":"ListItem","position":2,"name":"Replace wordpress cron with a real cronjob"}]},{"@type":"WebSite","@id":"https:\/\/cpanelplesk.com\/wp62\/#website","url":"https:\/\/cpanelplesk.com\/wp62\/","name":"cPanel Plesk","description":"Blog on famous hosting control panels","publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13","name":"Farooq Omer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","width":300,"height":44,"caption":"Farooq Omer"},"logo":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/"},"url":"https:\/\/cpanelplesk.com\/wp62\/author\/fokado\/"}]}},"_links":{"self":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/3346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/comments?post=3346"}],"version-history":[{"count":0,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/3346\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media\/3349"}],"wp:attachment":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media?parent=3346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/categories?post=3346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/tags?post=3346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}