Skip to content

Settings

Export and import settings

Save all Stack Guard settings to a file as a backup, or copy a proven setup from one site to another in a minute.

What it does

Export Settings downloads a small file with every Stack Guard setting, including firewall rules, the content security policy and alert templates.

Import Settings reads such a file and applies it. Settings missing from the file are left as they are.

Why it matters

A backup lets you undo a change that went wrong. For agencies, one well-tuned site becomes the starting point for every other.

Set it up

  1. On the source site, go to the Settings tab, section Backup and transfer, and click Export Settings.
  2. On the other site, open the same section and choose the file in Choose a settings file.
  3. To make this site match the file exactly, switch on Reset everything to defaults first (the login address, keys and allow list are kept). Then click Import Settings.
  4. Read the result line. It warns if the login address setting or the alert recipients changed, so nobody is surprised.

Good to know

Secrets and site-specific values are never exported: API keys, CAPTCHA keys, the license, the login slug and access token, the IP allow list, proxy settings, the blocked-access page, the list of users who must use two-factor, and logos.

Because the login slug is not exported, an import can switch on Custom Login URL with this site's own slug. Check the Login tab after importing.

An import never switches on a paid feature the site's plan does not include.

A preview of changes before importing is on the roadmap.

Which plan includes it

Export and import are in every plan and need full access to Stack Guard.

How it works, for developers
  • The file is JSON named stack-guard-settings-YYYY-MM-DD.json, with the plugin version, export time, site address and settings. Included: every registered setting in the smg_settings group plus firewall rules, CSP, HSTS and templates.
  • Never exported: the list in SMG_Admin::EXPORT_NEVER.
  • Import skips unknown keys and values of the wrong shape, checks firewall rules and templates again, and uses SMG_License::import_blocked() to keep paid features off.
  • Limits: 10 exports a minute and 5 imports in 5 minutes. Both need manage_options and full access, and are written to the activity log.

Quick answers about export and import settings

What does Export and import settings do in Stack Guard?

Export Settings downloads a small file with every Stack Guard setting, including firewall rules, the content security policy and alert templates. Import Settings reads such a file and applies it. Settings missing from the file are left as they are.

Why use export and import settings on a WordPress site?

A backup lets you undo a change that went wrong. For agencies, one well-tuned site becomes the starting point for every other.

How do I set up export and import settings?

1. On the source site, go to the Settings tab, section Backup and transfer, and click Export Settings. 2. On the other site, open the same section and choose the file in Choose a settings file. 3. To make this site match the file exactly, switch on Reset everything to defaults first (the login address, keys and allow list are kept). Then click Import Settings. 4. Read the result line. It warns if the login address setting or the alert recipients changed, so nobody is surprised.

Which Stack Guard plan includes export and import settings?

Export and import are in every plan and need full access to Stack Guard.

More in Settings

Not running Stack Guard yet? It is free.

Download Free