I need to remove properties from multiple places with powershell script. I tried many examples from net, with null assigning and using remove on Properties and AllProperties, or using method DeleteProperty, but the most I managed is to remove value. Can anyone suggest how to do that?

Edit: Well the problem was kinda project related, because custom tools displayed needed to delete keys on different casing than they really was and what confused me was, that the script could find properties with wrong casing key, but couldn't delete it. Other than that the simplest way is as bunzab had told

4 Answers 4


A couple of things:

Do not use Properties instead use AllProperties! There are methods on SPWeb to add update and delete property bag values and you should use them rather than dictionary methods on the property bag itself:


Kalpesh's comment is correct you can not delete a property from Properties but you can from AllProperties.

  • 1
    I have given comments based on SPWeb.Properties still we cannot delete property from SPWeb.Properties if SPWeb is root web as users1100 said. You can try by your self Jun 5, 2015 at 6:35
  • Yeah sorry my bad edited to reflect that..
    – Bunzab
    Jun 5, 2015 at 6:46

Its simple...

Access AllProperties then remove that specific property.

Note: AllProperties are not accessible by default. You need to explicitly Load CSOM properties.

Here is the code

$web = Get-SPWeb <url>
$web.DeleteProperty('test') // this is a key

Using PowerShell script you can use below cmdlets to remove the web properties.

$web = Get-SPWeb <weburl>
$web.Properties  # Lists the updated properties

Hope this helps!

  • We cannot delete SPWeb Property once its added. We can just clear it's value. Jun 5, 2015 at 6:17
  • As per my knowledge, if it is sub web then we can delete it.
    – users1100
    Jun 5, 2015 at 6:23

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.