Improve WP Cron with Real Cron Job or Monitoring Sites

Default WP setups use a virtual cron feature where maintenance and scheduled tasks occur when site scripts are triggered (when somebody visits site).

That works fine for active sites that have a fluent visitors stream. On projects where WP is not fluently visited these task don’t get triggered as expected.

 

Solution 1

Setup a real cron job from cPanel .

/usr/bin/wget -q -O – http://[yourwebsite.com]/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Can be hourly or each 15, 30 minutes.

Optionally disable WP cron from wp-config.php :

define(‘DISABLE_WP_CRON’, true);

Solution 2

Schedule an online  status monitoring service to check your WP based site.  When they check they will also trigger your WP scripts.

Ex. StatusCake.com or UptimeRobot.com

 

WP cron triggers various functionality:

  • Checking for theme & plugin updates
  • Publish scheduled posts
  • Sending pingbacks
  • Other actions scheduled by plugins like converting videos, cleaning files or database

Top Plugins to Optimize and Secure WordPress

Speed Up and Secure

  1. WordFence
    Enable firewall, periodic scans, failed login block, secure passwords.
  2. WP Super Cache
    Speed up delivery of static content and pages: configure it for visitors to prevent overload by bots/crawlers.
  3. Use Google Libraries
    Load JS from CDN. Reduce load.
  4. WPS Hide Login
    Protect from brute login.
  5. Robots.txt File
    Edit the robots.txt file.

Troubleshooting Tools

  1. P3 Plugin Performance Profiler
  2. Server IP & Memory Usage Display

Configuration

  • robots.txt

    User-agent: *
    Crawl-delay: 90
    Disallow: /wp-admin/
    Disallow: /wp-includes/
    Disallow: /streams/
    Disallow: /wp-login.php
    Disallow: /wp*

    User-agent: MJ12bot
    Disallow: /