I have a big List which I want to empty. Therefore I create a template from that list, delete the list and create a new list from the template I just saved before.

I know there are other possibilities in deleting items from lists and also know of the drawbacks (especially regarding LookUps)

Now the threshold is too small and I do not want to change that in the central administration.

I also know I can override that threshold in Querys:

SPQuery q1 = new SPQuery();
q1.QueryThrottleMode = SPQueryThrottleOption.Override;

But I do not want to execute a SPQuery, but do the following:

listCopy.SaveAsTemplate(backupName, backupName, string.Empty, false);

(listCopy is an object of Type SPList)

Can I override the throttle there too? How? Or can I achieve the same (saving a template and deleting List) with SPQuery also?

2 Answers 2


If you use SharePoint Server 2010 and not SharePoint Foundtation you can enable SharePoint Publishing Infratstucture that will give you "Manage Content and Structure" there you can delete up to 1000 items at once.

You can also access "Manage Content and Structure" with the following url: http://www.yourservernamehere.com/_layouts/sitemanager.aspx

When you delete items there this causes a so called "Long Waiting Operation" which won't cause any timeout.

Another way is to use a powershell script to empty the list. I have a power shell script on my blog that used the ContentIterator to delete all versions of a document.

The ContentIterator is the best way to avoid the SPQueryThrotteling but shouldn't be used only for administrative tasks.

I'm sure you can use parts of this to delete all items from the list. http://www.n8d.at/blog/cleanup-item-and-file-versions-in-sharepoint-using-powershell/

There is no thotteling problem in this because it creates a on time timer job.

  • I have no Access to the powershell. The ContentIterator seems nice, but because I have to iterate through each element using "foreach item in" I cannot delete that item (item.Delete()) there. (correct me if I am wrong)
    – Ole Albers
    Aug 9, 2012 at 15:23
  • You can always use instead of a foreach an old school for loop and in there you should be able to delete the items. Aug 9, 2012 at 15:31
  • Found my mistake. I used list.Items.DeleteById() instead of directly deleting the item. Will add that as an answer. Your answer led the way. So thanks :)
    – Ole Albers
    Aug 9, 2012 at 15:46

Following Stefans instructions this is my (working) solution. Thanks

ContentIterator iterator = new ContentIterator();     
iterator.ProcessListItems(listCopy, string.Empty, true,                                                                                                   delegate(SPListItemCollection items)
       for (int i=0; i<items.Count; i++)
    }, null

And it is quite fast compared to "normally" deleting those lines. );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.