Move icon sets to another site
Take an icon collection to another site as a pack: export and upload in Icons, Packs, use WP-CLI, or commit the unzipped pack to your repository.
Every collection can leave a site as a pack, a ZIP with manifest.json and the SVG files. It does not matter what made it: an icon set, a folder, the theme or the free icon library. Details: Icon packs.
Switches
| Way | Old site | New site |
|---|---|---|
| wp-admin | license active | Icon set editor |
| WP-CLI | WP-CLI | WP-CLI and Icon set editor |
| Folder in the repository | license active | Theme & folder sources |
For the Icon block on the new site also Multiple collections.
The three ways
Export
Old site: Icons → Packs, list Export a collection, click Download next to the collection. Several at once: select them, then Download as one zip.
Import
New site: Icons → Packs, Import a pack, then Choose a pack… or drop the ZIP.
Name taken?
If a collection of that name exists, the site offers a free name. Click Import under that name, or cancel and rename the other collection first.
# Old site
wp easy-svg pack list
wp easy-svg pack export house-icons --file=house-icons.zip
# New site
wp easy-svg pack import house-icons.zip --as=house-icons
Unzip the pack into a folder and commit it:
mkdir -p wp-content/easy-svg-icons/house-icons
unzip house-icons.zip -d wp-content/easy-svg-icons/house-icons
git add wp-content/easy-svg-icons/house-icons
Every site deployed from that repository has the collection. Edits happen in the files, not in wp-admin.
When it worked
- wp-admin: "48 icons imported as house-icons."
- WP-CLI:
Success: 48 icons imported as house-icons. - Repository:
wp easy-svg icons listshowshouse-icons, and in Icons → Packs its origin reads "Folder wp-content/easy-svg-icons/house-icons".
What travels, what stays
| Upload or WP-CLI (becomes an icon set) | Folder in the repository | |
|---|---|---|
| Icon names, labels, drawings | yes | yes |
| Keywords | no | yes |
license, author, source from the manifest | yes | yes |
| Style templates, icon history | no | no |
Pitfalls
- Keep the name, keep the content. Posts, blocks and fields store
collection/icon. If the import lands ashouse-icons-2, those references on the new site point at nothing. Pass--as=or rename the old collection before you import. - WP-CLI never asks. On a taken name it warns
house-icons was taken; registering as house-icons-2.and imports anyway. - A folder moves aside on its own. If its name is taken, it uses the folder's name, then a number. Once the other collection is gone, it gets its name back.
- Exporting the free icon library gives a pack like any other. On the new site it becomes a Pro icon set, not part of the free library.