Function API only Updated 17 Oct 2026
unpublish(guid)
Removes a publication of a folder or document inside the site. Only available in API mode (.js endpoints), and only when the subscription has SaaS enabled.
Parameters
guidstringrequiredThe publication's guid, as publishFolder, publishDocument and getPublications return it.
Returns
true when the publication was removed.
Only publications of something inside the site can be removed — never the site's own publication. A guid outside the site, an already removed publication and an unknown guid all give the same error: "unpublish failed, publication not found in the site".
Example
Mixed HTML (or any text file) with inline JavaScript between hash signs.
// A customer cancels — take their website offline
let pub = docly.getPublications("#/Websites/ola")[0];
if (pub) docly.unpublish(pub.guid);