Skip to content

[00] Settings, User guide

Moving settings between sites

Export a Subset plugin's settings as a JSON file and import it on another site, from wp-admin or WP-CLI, and what the file leaves out.

Set a plugin up once, then copy its settings to the next site. Each plugin that supports it has an Import and export tab on its settings screen, and wp subset settings copies one plugin or all of them from the command line.

PluginFrom version--plugin name
Subset SEO0.14.0seo
Subset Opt-Out0.12.0cookie-manager
Subset Redirects0.14.0redirector
Subset Sizes0.14.0image-resizer
Subset Search1.13.0search
Subset Clone0.13.0duplicator
Subset Mail0.8.0mail
Subset Sync0.28.0sync
Subset Fill0.13.0content-builder

Subset Redirects calls its tab Copy settings, because its Import & Export tab already moves redirects as CSV.

Export and import in wp-admin

  1. Open the plugin’s screen under Subset, for example Subset → Image Sizes.
  2. Open the Import and export tab.
  3. Select Download settings.

You get a JSON file named after the plugin. To import it:

  1. On the other site, open the same plugin’s Import and export tab.
  2. Choose the file, or paste its contents into the box under it.
  3. Select Check file. The tab lists each setting that would change, with its value now and its value from the file. Nothing is saved yet.
  4. Select Import settings to save them, or Cancel.

A setting that isn’t in the file keeps its value on this site. To replace every setting instead, reset the plugin’s settings first, or use --reset in WP-CLI.

Export and import with WP-CLI

wp subset settings works for every plugin at once. --plugin takes the plugin’s wp subset name from the table above.

# Export one plugin, or every active plugin.
wp subset settings export --plugin=search --file=search.json
wp subset settings export --all --file=subset.json

# See what an import would change, then import it.
wp subset settings import subset.json --dry-run
wp subset settings import subset.json --yes

--reset resets each plugin’s settings to their defaults first, so the file replaces them. import - reads the file from standard input, and export without --file prints it. On a multisite network, pick the site with --url.

What the file holds

  • Saved settings only. A setting you never changed isn’t in the file, so the other site keeps its own default.
  • Not API keys or passwords. After an import, the plugin lists any key the site still needs.
  • Not data. Redirects, the search index and the search log, image files and logs stay where they are.
  • Not what belongs to one site. Subset Sync’s site key, connections, profiles and This is a production site setting stay on their site, and so do Subset Mail’s network-wide mailer settings.
  • Settings pinned in wp-config.php are named, so you can add the same constants.

If any value in the file is the wrong type or one the settings screen wouldn’t accept, the import saves nothing and lists the problems. It also says which settings it skipped: ones this site’s plugin doesn’t have (an inactive Pro add-on’s, say), ones locked here, and values that only make sense on the site they came from, such as image sizes this site doesn’t register.

Network defaults in the file

A network administrator’s export also holds the plugin’s network defaults and locks, which only another network’s administrator, or WP-CLI, can import.