Sitefinity CMS

Deleting Blogs Send comments on this topic.
See Also
Developing with Sitefinity > Modules > Modules API > Generic Content Based Modules > Blogs > Blog Items > Deleting Blogs

Glossary Item Box

There is one method for deleting a blog:

  • DeleteBlog(Guid id) - Pass the ID of the blog that will be deleted

Delete a blog by specified ID:

Copy Code
// create new instance of BlogManager
Telerik.Blogs.BlogManager blogManager = new Telerik.Blogs.BlogManager();
// get all blogs
IList listOfAllBlogs = blogManager.GetBlogs();
if (listOfAllBlogs.Count > 0)
{
   
// get the first blog item
   
Telerik.Blogs.IBlog firstBlog = blogManager.GetBlog(((Telerik.Blogs.IBlog)listOfAllBlogs[0]).ID);
   
   
// delete the item from the database
   
blogManager.DeleteBlog(firstBlog.ID);
}  

 

See Also