Sitefinity CMS allows you to unpublish and then delete the PageNode and the underlying PageData through the code.
To unpublish and delete a page:
Get the page node or data.
When deleting the page, first, you must get the page node or data. For more information about finding a specific page node and data, see For developers: Query pages.
Unpublish the page.
It's a good practice, to set the ApprovalWorkflowState to Unpublished before doing the deletion.
The following example uses the Native API to unpublish the page with the specified Title:
Delete the page.
After you get and unpublish the page, you delete it.
Save the changes.
Finally, you must save the changes.
To delete a page you can use the Native API or the Fluent API.
To delete a page using the Native API, you must use the PageManager class. For more information, see Delete a page using Native API.
To delete a page using the Fluent API, you must use the page facade. For more information, see Delete a page using Fluent API.
To delete a specific page with the Native API, you use the PageManager class and LINQ queries.
The following example deletes the page with the specified Title:
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting your Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity ASP.NET Core and take advantage of its decoupled architecture and modern development model.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important