Delete old versions

Does anyone know if there's a way to delete old verions of all pages? Since the default value in EPiServer is "unlimited" some of our pages have over 450 verions. If i set the allowed verions to 100, which is the top limit, it's to much work and the databaseconnection timeout. There must be a stored procedure or SQL-script to fix this.
Mar 09, 2006 9:33
You probably just need to increase the query timeout for the database. There are two settings for this. The first is to update the key in the web.config EPnQueryTimeout, make it 600 or something like that (600 = 10 minutes). The other is to update the SQL Server properties. Go to Enterprise Manager, [You database] Properties > Connections > Edit query timeout value here (Should default to 600 also). Jeremy.
Mar 09, 2006 21:48
Hello! I just added a code sample that clears old versions from the database as a scheduled job. It also shows how it's possible to set the user context when executing a scheduled job. This feature was added in EPiServer 4.61 and does not work in older versions.
Jul 04, 2006 11:36
Tried the link in the previous post but its not valid. Would be happy if someone could repost the code example. Thanks.
Feb 16, 2007 13:40

On the Support Tools page ( you'll find a job called RemoveOldPageVersionsJob. It enumerates pages, calling the SP editDeleteObsoletePageVersions to truncate the number of kept versions.

Nov 09, 2010 13:49
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.