geek programmer geek programmer - 2 months ago 18
PHP Question

How to Replace the WordPress Cron with a Real Cronjob every 30 mintes

I want to replace wordpress cron job with real cron job in php.
i tried to change wp-config.php with,

define('DISABLE_WP_CRON', false);


And it's not working. and another problem is that i want to make it every 30 minutes so for that i made one cron job in cron job tab of cpanel. so i tried with minutes (0,30) and hour etc. with start.

I started error_reporting() but also it's not showing any errors.

Answer

irst, you need to disable the file to be hit every time someone loads your pages. To do this, open the wp-config.php file in your main WordPress folder and add this line at the end, before the closing ?> tag.

define('DISABLE_WP_CRON', true); 

And make your cron job setting like below picture. Change path of your cron job according to your cpanel directory.

enter image description here