I just had a problem where I had just over 1K of nodes which had
accumulated in my Recycle Bin while developing a large new umbraco
site. But every time I clicked empty Recycle Bin the pop up
would open and it would say deleting nodes, but it wouldn't do
anything.
After a bit of searching around I found a great SQL script from
the Umbraco legend Doug Robar for
deleting all nodes in the Recylce bin for an older version of
Umbraco, with a bit of tinkering I have updated it to work with
v4.7.
*** USE THIS AT YOUR OWN RISK!! ***
It has worked fine for me, but back up your DB before you do
it.
-- Uncomment below to verify the number of nodes returned is the
-- same as the number of nodes that is in the Recycle Bin
-- select * from umbracoNode where path like '%-20%' and id!=-20
-- Delete all 'related' nodes and table contents...
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