SPF, DKIM and DMARC setup guide for WooCommerce stores
Every WooCommerce store sending order receipts or newsletters from its own domain needs three DNS records: one SPF TXT record (at most 10 DNS lookups under RFC 7208), one DKIM signing key per active mail service, and one DMARC TXT record at _dmarc.yourdomain.com starting at v=DMARC1; p=none;. Google and Yahoo require full SPF, DKIM and DMARC authentication for bulk senders above 5,000 messages per day.
Updated By THTheme Editorial Team
Key facts
- Publish only ONE v=spf1 TXT record per domain or subdomain; two records cause automatic PermError
- RFC 7208 section 4.6.4 limits SPF evaluation to 10 DNS-querying mechanisms (include, a, mx, ptr, exists, redirect)
- Each sending tool (Workspace, Postmark, Klaviyo, helpdesk) needs its own DKIM selector key
- DMARC passes if EITHER SPF or DKIM passes AND aligns with the visible From header domain (RFC 7489)
- Gmail and Yahoo require aligned DMARC (at least p=none) for bulk senders sending 5,000+ messages/day
| Record | DNS host / name | Type | What it proves |
|---|---|---|---|
| SPF | @ (or subdomain) | TXT | Which servers/IPs are authorized to send for the Return-Path domain |
| DKIM | selector._domainkey | TXT or CNAME | Message was cryptographically signed and not altered in transit |
| DMARC | _dmarc | TXT | How receivers handle unaligned mail plus where to send XML reports |
1. Build a single valid SPF record
Inventory every system that legitimately sends email using your domain: your corporate inbox (Google Workspace or Microsoft 365), your WooCommerce transactional mailer (Amazon SES, Postmark, Brevo or Mailgun), your newsletter platform and your support desk. Combine them into one TXT record at the root (@):
v=spf1 include:_spf.google.com include:amazonses.com ~all
- Never create a second
v=spf1TXT record on the same hostname. Edit the existing one instead. - Avoid
+all(allows anyone on the internet to spoof you) and deprecatedptrmechanisms. - Watch nested includes: some platforms consume 3 to 5 lookups inside a single
include:, pushing stores over the 10-lookup ceiling.
2. Publish DKIM keys for every sender
Unlike SPF, which breaks when messages are forwarded, DKIM signatures travel inside the email header itself. Inside each mail service's domain settings, generate its DKIM DNS records (usually 1 to 3 CNAME or TXT entries under _domainkey) and add them to your DNS host (Cloudflare, Route 53, GoDaddy, etc.).
- In Cloudflare DNS, always keep DKIM CNAME records set to DNS only (grey cloud). Proxying them breaks resolution.
- Rotate keys periodically if your provider supports automated dual-selector rotation (Amazon SES Easy DKIM and Postmark do this cleanly).
- Use 2048-bit RSA keys whenever your DNS host accepts TXT strings over 255 characters.
3. Roll out DMARC in three safe phases
Publishing p=reject immediately before verifying every plugin, billing tool and CRM will block real customer receipts. Move in stages:
- Monitor (weeks 1 to 2):
v=DMARC1; p=none; rua=mailto:[email protected]; adkim=r; aspf=r;Read aggregate reports to catch forgotten senders (contact forms, accounting tools, shipping apps). - Quarantine (weeks 3 to 4): change to
p=quarantine; pct=25;, then raisepct=100once legitimate pass rate reaches 99%+. - Reject (steady state): set
p=reject;to stop spoofed phishing emails using your brand domain.
Test your published records in seconds using the free SPF, DKIM and DMARC checkers at DeliverabilityRecovery (same owner as THTheme). If reports show persistent misalignment or broken DNS flattening, it also runs 24-hour deliverability audits ($1,500).
4. Check header alignment on a real WooCommerce order
Place a test order (or trigger an invoice email from an existing test order) to a Gmail address. Click the three-dot menu and open Show original. Verify that the visible From: domain matches the DKIM d= signing domain (DKIM alignment) and, ideally, the Return-Path domain (SPF alignment). Both relaxed alignment (same organizational domain, such as orders.store.com and store.com) and strict alignment pass standard DMARC checks.
If authentication passes but mail still hits spam, follow our WooCommerce spam troubleshooting guide.
FAQ
What happens if my domain has two SPF records?
Under RFC 7208 section 3.2, receiving mail servers return an SPF PermError when multiple v=spf1 TXT records exist on the same hostname, causing SPF authentication to fail.
Does DMARC require both SPF and DKIM to align?
No. Under RFC 7489, DMARC passes if either SPF passes with alignment or DKIM passes with alignment, though configuring both protects against forwarding failures.
Why do Cloudflare DKIM CNAME records fail verification?
Most often because the Cloudflare proxy (orange cloud) is turned on for the CNAME record. Switch DKIM CNAME records to DNS only (grey cloud) so mail servers can read the public key.
Can I use a subdomain for WooCommerce emails without hurting my root domain?
Yes. Sending transactional emails from a subdomain such as orders.yourdomain.com lets you set dedicated SPF and DKIM records and isolate reputation while inheriting root organizational DMARC alignment.
Sources
- RFC 7208: Sender Policy Framework (SPF)
- RFC 7489: DMARC Specification
- Google: Email sender guidelines
- Cloudflare Docs: Manage DNS records for email