Delete Umbraco 8 History

When working on Umbraco 8, every time to make a change in the back office that change is logged in the history. That is OK for when the site is live, as it allows the administrator to rollback any changes if needed or to see who has made changes in the CMS.

But after development, you may not want the client to see what changes you made in the CMS, so you will need to delete the history.

In this short blog, I will show you how to achieve this before pushing the site up to the live environment.

SQL Code

To start, open up SQL Server and click on 'new query', select your database and then copy the code below, changing the database name to your database and then click 'Execute'

SELECT TOP 1000 [id]
      ,[userId]
      ,[NodeId]
      ,[entityType]
      ,[Datestamp]
      ,[logHeader]
      ,[logComment]
      ,[parameters]
  FROM [cmsDefaultUmbraco].[dbo].[umbracoLog]

If all goes well, you should see something similar to the image below.

History data

Delete Umbraco 8 history

If you now copy the following code and click 'Execute', the data in the table will now be deleted

delete [cmsDefaultUmbraco].[dbo].[umbracoLog]

Run SQL code again

If you know run the following code again, you will see that all the history has been deleted

SELECT TOP 1000 [id]
      ,[userId]
      ,[NodeId]
      ,[entityType]
      ,[Datestamp]
      ,[logHeader]
      ,[logComment]
      ,[parameters]
  FROM [cmsDefaultUmbraco].[dbo].[umbracoLog]
Summary

Thank you for taking the time to read this short blog about deleting Umbraco 8 history, I hope you found it helpful.