Empty Umbraco Wastebasket with 1000s Items

This sorted it for me when I couldn't empty the recycle bin. I had to run it twice becuase I got a sql constraint error the first time.

Republish the entire site afterwards, as well, just to make sure

http://www.blogfodder.co.uk/2011/5/26/mass-delete-over-1k-nodes-from-recycle-bin-in-47

 

delete from cmsPreviewXml where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsContentVersion where ContentId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsContentXML where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20)
-- delete the XML nodes....
delete from umbracoNode where path like '%-20%' and id!=-20

 

Posted by Tom at 00:00

Post a comment

Authors