Skip

Setup Cron Jobs

Estimated reading: 8 minutes 2939 views

Bit Social uses WordPress cron tasks to process Auto Post, Share Now, and scheduled social posts at the appropriate time. WordPress uses WP-Cron by default, but WP-Cron depends on website activity and may run late on low-traffic sites. A real server cron or Bit Social External Cron can trigger these tasks more reliably.

Cron jobs are automated tasks that run at set times, like updates or backups. In WordPress, these tasks are managed by WP-Cron. WP-Cron runs scheduled tasks based on site visits. Every time someone visits your site, WP-Cron checks if any tasks need to run and executes them. For more reliable scheduling, especially on low-traffic sites, you can set up real cron jobs on your server to trigger WP-Cron regularly, ensuring tasks run on time.

Check out our easy-to-follow tutorial!

Setup Cron Jobs

Check the Default WP-Cron Setup: By default, WordPress has WP-Cron (its internal cron job system) enabled, so you usually don’t need to do anything to activate it. It runs whenever there’s site activity, like page visits or post publishing.

Enable WP-Cron if Disabled: If you’ve previously disabled WP-Cron, you can re-enable it by removing or commenting out the line in your wp-config.php file that disables it:

define('DISABLE_WP_CRON', true);

Remove or comment out this line, or change it to:

define('DISABLE_WP_CRON', false);

Verify Scheduled Tasks: Use a plugin like WP Crontrol to manage and view scheduled tasks. You can install it from the WordPress plugin repository to make sure cron jobs are running properly.

Once enabled, WP-Cron will handle scheduled tasks like publishing posts and running plugin events automatically, based on site activity.

Understand WordPress Cron: WordPress uses its own internal cron system (WP-Cron) to schedule tasks like publishing scheduled posts, sending emails, and more. However, WP-Cron relies on site traffic to trigger tasks, which can be unreliable for high-traffic or low-traffic sites.

Set Up WP-Cron: By default, WordPress has WP-Cron enabled, but for more precise and reliable scheduling, you can disable WP-Cron and use server cron jobs.

Disable WP-Cron: Open your site’s wp-config.php file and Add the following line before the end of the file

define('DISABLE_WP_CRON', true);

This disables the built-in cron system.

Set Up Server Cron Job: Access your hosting control panel (like cPanel) or use SSH to access your server. Look for the “Cron Jobs” section. Set up a new cron job with the following command:

wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Replace “yourdomain.com” with your actual site’s URL.

Choose Cron Frequency: Select how often you want the cron job to run (e.g., every 5 minutes, hourly, daily). For most tasks, setting the cron to run every 5-10 minutes works well.

Test Your Cron Job: After setting up the cron job, monitor your scheduled tasks (like post publishing or plugin updates) to ensure everything runs smoothly.

By setting up a reliable server cron job, your WordPress tasks will run on time, regardless of site traffic.

To set up the Cron feature in Bit Social, go to Bit Social and click on “More” from the top menu then click on “Settings“.

Setup Cron Jobs - Click on More
Setup Cron Jobs - Click on Settings

Cron Jobs: Cron jobs are tasks that run automatically at set times. They help with routine jobs like checking for updates, publishing scheduled posts, and cleaning up old files.

How They Work in WordPress: In WordPress, cron jobs are managed by something called WP-Cron. Unlike regular cron jobs on a server, WP-Cron runs when someone visits your website. Every time a visitor comes to your site, WP-Cron checks if any scheduled tasks need to be done and then runs them.

If your site doesn’t get any visitors, the tasks might not run on time. This is how WP Cron works. To schedule your posts and ensure everything runs smoothly, you need to overcome this. Therefore, you must set up a cron jobs on your server to work perfectly. This ensures that your scheduled tasks always run on time, even if your site has no traffic.

Cron Job settings

Under Cron job settings, you will find your Cron Job command. Copy this command, then go to your cPanel and search for “Cron Jobs.” Click on “Cron Jobs,” and scroll down to the Common Settings drop-down option. Choose a time from the Common Settings, paste the copied command into the command field, and click “Add New Command.”

info-icon-bit-apps  INFO

While setting up cron jobs, you had chosen a specific time. After setting them up, your server will hit the URL at the intervals you set. Your server will call WordPress cron at the interval you choose, allowing Bit Social to process due scheduled posts even when your site has little or no visitor activity.

Setup Cron Jobs - Corn Job Settings
Cron - Bit Social - cPanel

info-icon-bit-apps  INFO

A real server cron is recommended when you need more reliable scheduling than visitor-triggered WP-Cron can provide. If your hosting includes cron management, copy the Bit Social Cron Job command and add it there.

External Cron

External Cron lets Bit Social trigger your site’s WordPress cron externally, so scheduled tasks do not have to wait for a visitor to open your website. When enabled, Bit Social’s external cron service periodically calls your site’s WordPress cron endpoint so due social posts can be processed. External Cron is available with Bit Social Pro. It is useful when your hosting does not provide an easy way to configure a server cron or when your website receives little traffic.

info-icon-bit-apps  INFO

If you enable external cron, we will set up the cron jobs for you, making sure your WordPress site stays active and your scheduled posts are shared without any problems. To use this feature, you need the premium version of Bit Social.

Setup Cron Jobs - External Cron

For Cloudways, select “wget” as the type, then copy your command from https:// to cron and paste it into the URL field.

For example:

  • Type: wget
  • URL: https://yourdomain.com/wp-cron.php?doing_wp_cron
Setup Cron Jobs - Cloudways Cron

Late Post Handling

WP-Cron does not always run exactly on time. If your site has low traffic, cron is delayed, or the server temporarily stops processing scheduled tasks, a social post may become due before Bit Social gets a chance to publish it.

Late Post Handling lets you decide what Bit Social should do when that happens. You can allow a late post to publish or mark it as Missed after a specific amount of time.

Bit Social handles Auto Post and Share Now & Scheduled Share separately because they are used differently.

Auto Post

Auto Post delays are often used to control spacing rather than publish at an exact time. Because of this, publishing a little late may still be useful.

You can choose:

  • Publish anyway: The post will still be published when cron runs, no matter how late it is.
  • Mark as Missed: Set how late the post can be before Bit Social stops the automatic publish and marks it as Missed.

When using Mark as Missed, enter a value and choose Minutes, Hours, or Days.

bit social late post handling settings

Share Now & Scheduled Share

Posts created with Share Now or Scheduled Share usually have a more specific publishing time. Publishing them several hours later may no longer make sense.

You can choose:

  • Publish anyway: Publish the post whenever WP-Cron eventually runs.
  • Mark as Missed: Do not automatically publish the post after the allowed late period has passed.

You can set a different late window from the one used for Auto Post.

bit social publish late post anyway

How repeating schedules are handled

For repeating schedules, Bit Social gives the schedule enough time to reach its next normal interval before considering a run Missed.

The allowed delay is at least one schedule interval or one hour, whichever is longer.

For example:

  • A schedule that repeats every 15 minutes gets at least a 1-hour late window.
  • A schedule that repeats every 2 hours gets at least a 2-hour late window.
  • A daily schedule gets at least a 1-day late window.

This prevents a slow WP-Cron from incorrectly marking every repeating run as Missed.

If you select Publish anyway, the late-time limit is removed.

What happens to a missed post?

A missed post is not deleted.

Bit Social marks the schedule as Missed and keeps a record of the missed publishing attempt. You can still publish the content manually from the logs.

This also prevents old scheduled content from suddenly being published much later when WP-Cron starts working again.

Share this Doc

Setup Cron Jobs

Or copy link

CONTENTS

Subscribe

×
Cancel