Skip to content

The Newsletter Plugin sending workflow: cron, batching and SMTP at scale

How The Newsletter Plugin actually sends on WordPress — the cron-driven batch loop, why campaigns stall on shared hosting, how to route sends through a real relay, and when to stop sending from WordPress.

The Newsletter plugin does not send a campaign in one shot. It sends in batches: WordPress fires a scheduled event, the plugin picks up the next max_emails pending recipients, hands them to whatever delivery path you configured, then goes back to sleep until the next trigger. Almost every large-send complaint — a campaign frozen at 1,200 of 9,400, messages trickling out over three days, half the list landing in Junk — traces back to one of three points in that loop: the trigger never fires, the batch is sized wrong for the host, or the delivery path is still PHP mail() instead of an authenticated relay. This guide fixes all three on a real cPanel or VPS host, and is honest about the list size at which you should stop sending from WordPress altogether.

What you’ll accomplish

  • A campaign that drains at a predictable rate whether or not anyone is browsing the site at 3 a.m.
  • WP-Cron replaced by a system cron that fires the Newsletter scheduler on a fixed interval, with an overlap guard.
  • A batch size chosen from your host’s PHP execution limit and your relay’s rate limit, not from a default.
  • Sends routed through an authenticated relay so SPF, DKIM and DMARC all align on the delivered message.
  • Bounces coming back into the subscriber table instead of quietly eating your send quota every campaign.

Prerequisites

  • WordPress 6.4 or newer with The Newsletter plugin 8.x active, and a subscriber list already in place.
  • Shell access with WP-CLI on the PATH. On cPanel that is usually Terminal or SSH plus a wp binary you installed yourself; on a VPS it is a normal login shell.
  • The ability to add a cron entry. cPanel exposes this as Cron Jobs; on a VPS it is crontab -e for the site’s user.
  • An account with a mail relay you control — Mailgun, SendGrid, Postmark, Amazon SES or a self-hosted relay. Newsletter can talk to several of these directly, or you can route site-wide through an SMTP plugin.
  • DNS control for the sending domain, because SPF, DKIM and a DMARC record are non-negotiable at campaign volume.

Shared hosting and a VPS differ in exactly two ways that matter here. On shared hosting your PHP max_execution_time is usually low, the host applies an hourly outbound message cap per domain, and you may not be allowed to run cron more often than every 15 minutes — all of which push you toward smaller batches and an external relay. On a VPS you control all three, so you can run a one-minute tick and a larger batch. Nothing else in the workflow changes.

How it works

Newsletter registers a scheduled event named newsletter in the WordPress cron table. When that event runs, the plugin looks for a campaign whose status is sending, reads the next slice of pending recipients, and attempts delivery for each one. It records progress by incrementing the sent counter on the campaign row, so a resumed run picks up exactly where the previous one stopped. There is no long-running worker process — the entire mechanism is “wake up, do a slice, exit.”

That design is fine right up until the wake-up stops happening. WordPress’s default cron is not a scheduler at all: it is a hook that runs at the end of a page request. No visitors, no ticks, no sending. A campaign scheduled for 2 a.m. on a business-hours site sits untouched until the first visitor arrives after breakfast, and then advances one slice per request.

Newsletter send pipeline from scheduled campaign to mailbox, with the failure that can occur at each stage

The second half of the pipeline is the delivery path. If you never configure one, wp_mail() falls through to PHP mail(), which hands the message to the local MTA on the web host. That message leaves from the shared host’s IP, carries no DKIM signature of yours, and is subject to the host’s hourly cap. It is the single most common reason a technically successful campaign gets filtered.

Step-by-step

  1. Establish what the plugin currently thinks it is doing. Before changing anything, read the campaign table and the subscriber counts, so you have a before-and-after number.

    wp plugin list --name=newsletter --fields=name,version,status
    wp db query "SELECT id, subject, status, total, sent FROM wp_newsletter_emails ORDER BY id DESC LIMIT 5"

    You should see the plugin active, and one row per campaign. A campaign with status of sending and sent well below total is a stalled send — that is the number you will watch move later.

  2. Get an honest subscriber count. Newsletter stores subscriber state as a single letter on each row: C confirmed, S subscribed but not yet confirmed, U unsubscribed, B bounced.

    wp db query "SELECT status, COUNT(*) FROM wp_newsletter GROUP BY status"
    status  COUNT(*)
    B       118
    C       9412
    S       604
    U       273

    If the B count is zero on a list older than a year, bounce processing is not running. Note that and come back to step 6.

  3. Take cron off page views. Add the constant to wp-config.php, above the “That’s all, stop editing” line.

    define( 'DISABLE_WP_CRON', true );

    Confirm WordPress agrees:

    wp config get DISABLE_WP_CRON
    1
  4. Install a system cron that actually fires the scheduler. Two entries: one general sweep, and a tighter one for the Newsletter event while campaigns are in flight. Replace <account> with the site’s system user.

    # every five minutes: everything else WordPress has scheduled
    */5 * * * * /usr/local/bin/wp --path=/home/<account>/public_html cron event run --due-now --quiet
    
    # every minute: the Newsletter scheduler only, guarded against overlap
    * * * * * /usr/bin/flock -n /tmp/newsletter.lock /usr/local/bin/wp --path=/home/<account>/public_html cron event run newsletter --quiet

    The flock -n matters more than it looks. Without it, a slow run that is still talking to the relay when the next minute arrives gets a second process working the same queue, and some recipients receive the campaign twice. Verify the event is registered and due:

    wp cron event list --fields=hook,next_run_relative | grep newsletter
    newsletter  now
  5. Size the batch against your PHP limit, not the default. Read the current value and your execution ceiling.

    wp option get newsletter_main --format=json | jq '.max_emails'
    wp eval 'echo ini_get("max_execution_time"), PHP_EOL;'
    "100"
    30

    The rule that holds up in production: one run should finish inside roughly a third of max_execution_time. An API-based relay takes on the order of 0.1–0.2 seconds per message, so 100 messages is about 15 seconds — comfortable at a 30-second ceiling. Plain SMTP with a TLS handshake per message is several times slower, and 100 will time out on the same host. Start at 50 on shared hosting with SMTP, 200 on a VPS with an API relay, and adjust from the measured drain rate rather than from a guess. Set the value in the plugin’s sending settings; the option is the same one you just read.

  6. Route the send through a relay and authenticate the domain. You have two places to configure this: Newsletter’s own delivery settings, or a site-wide SMTP plugin that intercepts wp_mail(). Pick one and leave the other empty, so there is exactly one answer to “where does mail go.” If you are configuring site-wide, WP Mail SMTP setup covers the credential handling; if you are standing up the relay itself, the Mailgun and SendGrid relay pattern covers domain verification and API keys. Then confirm DNS:

    dig +short TXT example.com | grep spf1
    dig +short TXT _dmarc.example.com
    "v=spf1 include:mailgun.org ~all"
    "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"

    The From address on your campaigns must be on the domain you verified at the relay. A From of news@example.com sending through a relay that only signs example.net will pass DKIM and still fail DMARC alignment.

  7. Close the bounce loop. You can read a bounce mailbox from WordPress with the plugin’s bounce handling, or let the relay do it and reconcile. The relay approach is more reliable, because the relay already parses the bounce and maintains a suppression list. Whichever you choose, the local table has to end up reflecting it — otherwise every campaign re-sends to dead addresses, burns quota against your hourly cap, and pushes your complaint rate up.

    wp db query "SELECT COUNT(*) FROM wp_newsletter WHERE status='B'"
  8. Decide on tracking before the first real send, not after. Newsletter can add an open pixel and rewrite links for click tracking. For a Quebec audience this is a Law 25 question and, for any EU subscribers, a GDPR one: you need a stated purpose and a lawful basis, and the privacy notice has to say that opens and clicks are recorded. Keep double opt-in enabled — Newsletter stores the subscription IP and timestamp on the subscriber row, and that pair is the evidence you will want if a complaint ever lands. If you cannot justify the tracking, turn it off; delivery does not depend on it.

Validate it works

Do not validate on the real list. Build a test segment of 15–25 addresses spanning Gmail, Outlook and at least one corporate domain, and send to that.

Watch the queue drain. With the campaign in flight, poll the campaign row:

watch -n 20 'wp db query "SELECT id,status,total,sent FROM wp_newsletter_emails ORDER BY id DESC LIMIT 1" --skip-column-names'

The sent value should climb by roughly your batch size every cron interval, and status should flip from sending to sent when it reaches total. A number that does not move for three consecutive intervals is a stall, not slowness.

Check the headers on something that actually arrived. Open a delivered test message and view the original. In the Authentication-Results header you want three passes and one alignment:

Authentication-Results: mx.google.com;
       dkim=pass header.i=@example.com;
       spf=pass smtp.mailfrom=bounce.example.com;
       dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=example.com

The part people miss is header.i versus header.from. Both say example.com above, which is what alignment means. If header.i shows the relay’s own domain, DKIM passed on the relay’s signature rather than yours and DMARC will not align.

Reconcile the counts. The relay’s log for that campaign window should show the same number of accepted messages as the plugin’s sent counter. A gap means messages were dropped between the batch loop and the relay, and the relay’s rejection log will say why.

Troubleshooting

The queue is stuck at the same count. Run the event by hand: wp cron event run newsletter. If the counter advances, your system cron is not executing — usually the wrong PHP binary, the wrong user, or a --path that does not match the WordPress root. Check the cron user’s mail spool or add >> /home/<account>/cron.log 2>&1 to the entry and read what it says. If the counter does not advance and the command returns immediately, the trigger is fine and the delivery path is throwing; look at the relay’s error log next.

Sends stop after a consistent number, every time. That is an hourly cap, not a bug. cPanel and WHM enforce a maximum number of outbound messages per domain per hour, and once the account hits it, further messages are deferred or rejected locally. The fix is not to raise the cap and hope — it is to stop sending through the local MTA at all. When Newsletter talks directly to a relay’s API, the host’s local counter is never touched.

Messages land in spam even though the plugin says they were sent. Check the From domain against what the relay signs. The classic pattern is a site configured with a relay for example.com while the campaign’s From address was left at the WordPress default of wordpress@server123.hostingco.net. DKIM passes, SPF passes, DMARC fails alignment, and mailbox providers treat the message accordingly. Set the campaign From address and the plugin’s sender address to the verified domain, and set the Return-Path to the relay’s bounce domain.

Some subscribers get the campaign twice. Two cron processes overlapped on the same batch. Add the flock -n wrapper from step 4 if you skipped it, and confirm there is not a second scheduler still running — a leftover cPanel cron entry, or WP-Cron still enabled because DISABLE_WP_CRON landed below the “stop editing” line in wp-config.php where WordPress never reads it.

The campaign completes far faster than the relay’s rate limit should allow. Messages are being accepted by the plugin and dropped before the relay. Lower max_emails until one run finishes well inside the PHP timeout, and check whether the relay is returning 429 responses that the plugin is counting as sends.

When this is the wrong approach

Sending from WordPress is a reasonable default up to a point, and past that point it stops being a hosting problem and starts being a product problem.

Decision table matching list size and send cadence to the right sending path

Move off WordPress when any of these are true:

  • The list is above roughly 50,000 confirmed subscribers, or you send several campaigns a week. At that volume the batch loop competes with page rendering for the same PHP workers, and a dedicated sending platform’s queue is simply better at the job.
  • You need real segmentation, automation branching or lifecycle campaigns. Newsletter does lists and basic autoresponders well. Multi-step behavioural flows are not what it is for.
  • Deliverability is a business metric someone reports on. Seed testing, reputation monitoring and per-ISP diagnostics live at the sending platform, not in a WordPress table.
  • You have no shell and no cron control. Without a system cron, everything in this guide degrades back to sending one slice per visitor, and no amount of tuning fixes that.

Equally, do not move off WordPress just because a send once stalled. A stalled campaign is almost always the cron trigger, and swapping plugins carries all the same problems to a new interface. If you are weighing the alternative inside WordPress, MailPoet makes a different tradeoff — it bundles a sending service — but the same cron and authentication questions apply there too. The plugin’s own documentation covers the settings screens, and the WordPress cron reference explains the scheduling model this all rests on.

Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.