removeFromTrashBin( )


Permanently deletes a draft post by the provided ID from the trash bin.

Uses the provided draftPostId to permanently delete a draft post from the trash bin. This action is permanent and cannot be reversed.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Blog
Learn more about app permissions.
Method Declaration
Copy
function removeFromTrashBin(draftPostId: string): Promise<void>;
Method Parameters
draftPostIdstringRequired

Draft post ID.

JavaScript
import { draftPosts } from "wix-blog-backend"; import { webMethod, Permissions } from "wix-web-module"; // Sample draftPostId value: "dd0907fa-ca4b-4fe4-ab9e-625e4733691e" export const myRemoveFromTrashBinFunction = webMethod( Permissions.Admin, async (draftPostId) => { try { await draftPosts.removeFromTrashBin(draftPostId); console.log("Permanently deleted the following draft post:", draftPostId); return; } catch (error) { console.error(error); // Handle the error } }, ); // Promise returns void
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?