Try our conversational search powered by Generative AI!

Error when trying to empty the recycle bin


I am having problems emptying the recycle bin in Episerver. I have approximately 16,000 items in the bin, and I receive a timeout error whenever I try and empty this. I have tried on several occasions to do this, but I receive the same error each time.

Is there another way to do this to get around the error?

Oct 24, 2016 9:58

Hi Sam,

Have you tried to run a scheduled job "Automatic Emptying of Trash"? It shouldn't time out.

Oct 24, 2016 11:57

When I tried running the scheduled task, it came up with the following error 'Connect failed'. I've been trying to work out of there is a SQL query that I can run directly on the database, but wanted to make sure that I don't leave loads of orphaned data in the DB.

Oct 24, 2016 12:14

Hi, Sam,

In case of many content items in the recycle bin, I'd suggest going to DB directly (Do back it up first). The timeout can be increased, however, if it's that many items, you'd need to increase it too much and it's valid for any other queries Epi executes.

So, instead, backup and run a SP called editDeleteChilds with page ID of recycle bin (usually 2).

Then, make sure to set up the scheduled job to get executed regularily :)


Oct 26, 2016 15:56

Hi Sam,

Agree with Marija but before that it is good idea to run this query " SELECT pkId, COUNT(*) FROM tblWorkPage GROUP BY pkID ORDER BY 2 DESC" and then from the sql result run editDeleteChilds with id of the page .. remember there is argument for editDeleteChilds for ForceDelete which if you pass "1" it will deleted even it is linked!

Oct 27, 2016 6:24

Thanks Marija and  Aria for your replies. I've just got my DBA to run the SP and although it did delete some items (around 1000), we are now receiving a constrainst error. When we try and re-run again, no further items are deleted.

Do we need to stop the main episerver service to get this to work?

Nov 02, 2016 14:06
* 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.