SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been developing some List Workflows on SPD 2010 and using the publish button to push them to the webserver. Everytime I publish a new version, the previous one gets labeled 'Previous Versions'.

Now, when I go to the Workflow Settings for that list, I can find at least a hundred workflows, most of them Previous Versions. If I check the workflows tab on SPD 2010 I only find the current version of my workflows.

Is there a way to remove all those previous versions from the Server?

share|improve this question
I have not worked with workflows in a long time but I remember vaguely. You should be able to remove the previous versions from the workflow settings page. – Nitin Rastogi Dec 26 '11 at 6:29
Is there a way to do this via UI instead of powershell? – Emon Jan 8 '14 at 21:58
up vote 3 down vote accepted

It should be possible using Powershell.

  1. You need to open the site and get the list.
  2. Iterate through list workflow association and remove whichever is not required.
  3. Sample code might look like this -

    $web = Get-SPWeb 'Web URL'

    $listToCancel = "List Name"

    $list = $web.Lists[$listToCancel]

    $tempList = New-Object "System.Collection.Generic.List``1[System.Object]"

    $wfToKeep = "Workflowname"

    foreach ($wf in $list.WorkFlowAssociations) {

    if ($wf.Name -ne $wfToKeep) { $tempList.Add($wf); }


    foreach ($wf in $tempList){ $list.RemoveWorkflowAssociation($wf); }

share|improve this answer
Excellent script. This helped me. – Kannan Sep 16 '12 at 8:15

There is a simple way to remove the Previous Versions of a workflow after you publish a workflow:

  1. Click List Settings
  2. Click Workflow Settings
  3. Click Remove a Workflow
  4. Select the radio button under the Remove column for every "Previous Version" item.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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