If editions share some layers, you need to delete all such editions at once, specifying all their ids, by means of the command to execute in the Command prompt window from the folder where GN4 resides (all in one line):
srv4 spike
-ids id1,id2,id3
-extend master.editionRef,page.editionRef,extDoc.editionRef,pageLayer.pages,txtGeometry.txtRef,txtGeometry.jumps,pagePreview.pageRef,article.pageLayers.pageRef,webComment.objectRef
-extendunref linkObject.pageLayers.editionRef,linkObject.pageLayers.pageRef,linkObject.pageLayers.layerRef,pageLayer.txtGeos
-unref linkObject.assigns,linkObject.assigns.pageRef,linkObject.assigns.extDocRef,pubDest.objs,pubDest.preObjs
–recurse
or
cmd4 spike
-ids id1,id2,id3
-extend master.editionRef,page.editionRef,extDoc.editionRef,pageLayer.pages,txtGeometry.txtRef,txtGeometry.jumps,pagePreview.pageRef,article.pageLayers.pageRef,webComment.objectRef
-extendunref linkObject.pageLayers.editionRef,linkObject.pageLayers.pageRef,linkObject.pageLayers.layerRef,pageLayer.txtGeos
-unref linkObject.assigns,linkObject.assigns.pageRef,linkObject.assigns.extDocRef,pubDest.objs,pubDest.preObjs
–recurse
-srvurl xxxx
-username yyyy -password zzzz
where xxxx is the URL of the server to connect to (in version 2.5 and newer, the URL is http://<myserver>/<myWebApp>/. In version prior to 2.5, the URL is the address of the Web service to connect to, e.g. http://<myserver>/<myWebApp>/Adminsrv.asmx.), the yyyy is the name of a GN4 user who can logon to system with sufficient permissions to perform this operation and zzzz is the password.
Note: the above connects to the default connection: should you want to specify the connection or server name, see cmd4 examples.
Note: pagePreview.pageRef applies since the version 1.5.
The above example deletes three editions with id1, id2 and id3, deleting at the same time all the master pages, pages and layers in the edition. Images linked to master pages are left untouched.
Images, text and articles linked to pages in the edition are deleted if they are not in a partition with 'extendSpike' set to false AND if they are not linked to any other page or master page.
If images, texts or articles are either in a partition with 'extendSpike' set to false OR if they are linked to other pages or master pages they are simply unlinked.
See also
Deleting individual pages and layers by command line
Spike REST call