trip

Knowledgebase

Run wp-cron manually from cron


Since WordPress is a web-based software, WordPress' cron jobs can only run when the website is accessed. One websites with low trafic, this might cause issues because the cron job won't run very often.

Deactivate WordPress' cron-function

  1. Open wp-config.php from cPanel's File Manager or from FTP
  2. Before the line "/* That's all, stop editing! Happy blogging. */", insert the following:
    define(‘DISABLE_WP_CRON’, ‘true’);​
  3. Save and close the file

Configure the manual cron-job

  1. Log into your cPanel account
  2. Go to Advanced > Cron Jobs
    cPanel Cron Job icon
  3. Under "Common Settings", select "Twice Per Hour". This will populate the fields directly under. You can run the cron job more or less frequently, but it's not recommended to run it more often than every 5 minutes.
  4. In the "Command"-field, enter one of the following:
    /usr/local/bin/php -q /home/USERNAME/public_html/wp-cron.php >/dev/null 2>&1​
    /usr/local/bin/ea-phpXX -q /home/USERNAME/public_html/wp-cron.php >/dev/null 2>&1​
    The first example uses the server's default PHP version. In the second example you can specify a specific version of PHP (fx ea-php74, which would be PHP v7.4)
    Remember to replace USERNAME with your cPanel username. Please note that the examples assume a WordPress installation for the primary domain (in the public_html folder). Change this path if needed.
  5. Click "Add New Cron Job"

 

wp-cron, cron


Was this answer helpful?

 Print this Article

Related Articles

Glemt adgangskode til WordPress

Hvis du har glemt adgangskoden til WordPress, er er der to nemme måde, det kan nulstilles på....

Hvordan installerer jeg WordPress?

Installation af WordPress kan klares nemt igennem Softaculous. Alle kunder har adgang til...

Installer og konfigurer LiteSpeed Cache i WordPress

LiteSpeed Cache er et cache-plugin til WordPress. Bruger dit website ikke cache, vil webserveren...