Load icon sets from your own server
Pull your agency's icon packs from your own server onto every site with WP-CLI in a deploy script.
Keep your icon packs as ZIP files on your own server. A deploy script installs them on every site, without anyone clicking.
Packs in a deploy script
wp easy-svg pack import reads a local file, so download first. The import always creates a new set, so check before you import:
#!/usr/bin/env bash
set -euo pipefail
SLUG="house-icons"
URL="https://icons.agency.example/packs/house-icons-1.2.0.zip"
if wp easy-svg pack list --format=json | jq -e --arg s "$SLUG" 'any(.[]; .slug == $s)' >/dev/null; then
echo "$SLUG is already installed, skipping."
exit 0
fi
TMP="$(mktemp -d)"
trap 'rm -rf "$TMP"' EXIT
curl -fsSL -o "$TMP/$SLUG.zip" "$URL"
wp easy-svg pack import "$TMP/$SLUG.zip" --as="$SLUG"
Switch on: WP-CLI and Icon set editor. The site's license must already be active (an administrator opened wp-admin once).
When it worked
Success: 48 icons imported as house-icons.
Pitfalls
- Run twice, get two sets. Without the check, a second run imports
house-icons-2. - "Turn on WP-CLI under Icons → Features": the switch is off, or the license is not active yet.
- Want the icons to follow every deploy, including changes? Put the unzipped pack in a folder instead, see Ship icon sets in your theme.
Was this page helpful?