Create function in functions.php with hook name to execute URL

AS said by Fleuv you can use wp_schedule_event() function to execute your code like this add_action(‘my_twfours_action’, ‘my_twfours_action_fn’); my_twfours_action_fn (){ //this code will execute every 24 hours } wp_schedule_event( time(), ‘daily’, ‘my_twfours_action’ ); //adding new cron schedule event To create your 2 minutes filter and then scheduling a cron jo is like function my_two_minutes_filter( $schedules ) … Read more

Cronjob returns a lot of REMOTE_ADDR, SERVER_PORT, SERVER_NAME, etc errors

You’re getting Undefined index errors because you’re loading the files directly and not rendered through the server. The server typically populates those values and it’s actually more secure to run with less elevated privileges (through an HTTP request). Throw your manual cron to a curl or wget — whichever you have installed on your server. … Read more