Short answer: if your domain’s mail is sent by Google Workspace, publish one SPF record at your domain, v=spf1 include:_spf.google.com ~all, and publish the DKIM key that the Admin console generates for you, then click Start authentication. If your store sends through something else, a different service’s records matter.
Reviewed
Symptom
A checker or a mail provider says your domain has no SPF record or no DKIM signature, and your business email (or your store’s email) is sent through Google Workspace. Or you use an SMTP plugin with a Google connection and want to know which records to publish.
Why it happens
SPF is a list in your domain’s DNS of the services allowed to send mail for your domain. DKIM is a signature that the sending service adds to each message. Both are published at your domain’s DNS host, the place that answers questions about your domain (often your registrar). You usually have to publish them yourself (Google says some domains already have them, see the notes below). The longer explanations are in the SPF guide and the DKIM guide.
One thing to settle first. Google Workspace is a service for mailboxes on your own domain, such as you@example.com. Records for Google matter when Google sends the mail you want to protect. A store often sends its order emails another way: through the web host, an SMTP plugin that uses another service, or a sending service. Then that service’s records matter, and Google’s records may not. Find out which service sends your store’s email in the hub guide.
This guide only covers a domain whose mail is sent by Google Workspace. Google’s pages describe Workspace domains, so we do not say here how to authenticate a custom domain for a personal Gmail account.
Fix
SPF
- List every service that sends mail for your domain. Google’s page says to include web servers, your host’s mail servers, contact-form mail and third-party senders, not only Google.
- Build the record. If Google Workspace is the only sender, Google gives this record:
v=spf1 include:_spf.google.com ~all
If you have other senders, Google’s page has a table of combinations. For example, Google plus Microsoft 365 is v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all. Google says a record can have up to 10 include: tags and recommends ending with ~all.
- Add it at your domain host. Make a TXT record. The host (name) is
@for your main domain. The value is your record. Some hosts want the value in quotes: check your host’s help. Google says you make this change at your domain host, not in the Admin console. - Keep one record. If an SPF record already exists, add
include:_spf.google.comto it instead of creating a second one. Google’s page does not discuss two records, but the standard does: see the SPF guide. If you have too many includes, see SPF too many DNS lookups. - Wait. Google says SPF can take up to 48 hours to take effect.
Google’s page says you may not need this step if your domain already has SPF by default, or if you bought the domain from a Google partner during sign-up. Check first with the free checker below.
DKIM
You need to be a super administrator, or have the Gmail Settings administrator privilege.
- Generate the key. In the Admin console go to Menu, Apps, Google Workspace, Gmail, then Authenticate email. Choose your domain, then click Generate New Record.
- Choose the key length. 2048 is the stronger one. Google says to use 1024 only if your DNS host does not support 2048 (some hosts limit the length of a TXT record).
- Keep the selector
googleunless your domain already uses that selector for another DKIM key. Google recommends it as the default. - Click Generate and copy both values. The host name is your selector plus
._domainkey(for examplegoogle._domainkey). The value starts withv=DKIM1; k=rsa; p=followed by your key. The key is made for your domain: copy it from the console, never retype it. - Do not click Start authentication yet.
- Publish a TXT record at your DNS host with that host name and that value. If you have several domains, generate a separate key for each one. If your DNS host adds your domain name on its own, type only
google._domainkey(see the DKIM guide for the double-domain mistake). - Wait. Google says DKIM can take up to 48 hours to start working after you add the key.
- Return to Authenticate email, pick your domain and click Start authentication. Google says the status then shows that mail is being authenticated.
Google adds one timing warning: after you turn on Gmail for a domain, wait 24 to 72 hours before generating the key. If you generate it earlier, you can get an error that the DKIM record was not created.
Check it worked
- Run the free checker on your domain. The SPF line should show a valid record. The DKIM line looks for the key under common selector names, and
googleis one of them. If you kept the default selector, it can show the key it found. If it says “Not checked”, that is not a failure: see the DKIM guide. - Send a real test. Google says to send a message to a Gmail or Google Workspace address that is not the sender (sending to yourself does not verify DKIM). In the recipient’s Gmail, open More, then Show original, and look in the Authentication-Results header for a DKIM result such as pass.
- If there is no DKIM line, the messages are not signed. Go through the steps again. Google also has a page for troubleshooting DKIM.
If it still fails
- The check finds no key right after you published it. Wait, as above, then check again before you change anything.
- The Admin console gave an error when you generated the key. Gmail may have been turned on less than 24 to 72 hours ago.
- Your store’s mail does not pass even though Google’s records are right. Your store may not send through Google. Find the service that does, in the hub guide, and publish its records.
- Your SMTP plugin cannot connect to Google (error 400, redirect_uri_mismatch). That is a sign-in setting in your Google Cloud project, not a DNS record. See Fix Gmail redirect_uri_mismatch in SMTP.
- Your mail goes to spam although SPF and DKIM pass. See Avoid WooCommerce emails going to spam.
- A gateway changes your messages. Google says a gateway that edits messages, for example by adding footers, can break DKIM signatures.
Google also recommends setting up DMARC next. See DMARC for beginners.
How the plugin helps
Email Health Check & Log for WooCommerce reads the mailer or SMTP host set in three popular SMTP plugins, and when it contains “gmail” it names the provider “Google”. If your SPF record then does not appear to include google.com, it warns you, and its fix help for a failing SPF check offers v=spf1 include:_spf.google.com ~all. For DKIM it shows the Admin console steps in words and tries a list of common selector names, including google. It does not verify a signature and does not change your DNS. Get the plugin on WordPress.org.