wp_schedule_event run in background or not?

It depends. The initial page load trigger should not but performance may degrade as visitors browse your site until the Cron job is finished.

Is the scheduled event you plan on using PHP or DB intensive? How often will it run?

Here’s how it works

  • The scheduled event (aka Cron job) will be initialized once it’s due (or past due) by whoever hits your website. So visiting www.test.com/somepage/ will tell Mr. WP-Cron, “Hey dude, it’s time to wake up and run this Cron job”.
  • If it takes 20-30 seconds to finish and is an intensive DB or PHP task (e.g. lots of DB INSERT or UPDATE statements, or parsing a huge .xml file, etc), there’s a good chance the site will be slow for anyone during that time. Especially if you’re on shared hosting due to shared CPU and memory.

If it’s a Cron job you run once a day or week, I wouldn’t worry about the performance hit.

Supporting Answer