Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to hide (or remove it from the new button drop) a SPContentType that is already in use via Powershell scripting.

Even if before:

$SPContentType.Hidden = $true
$SPContentType.Update()

I run:

$SPContentType.ReadOnly = $false
$SPContentType.Sealed = $false
$SPContentType.Update()

The exception error message "Content Type in use" is always throw.

Ideas? Is possible to hide an CTyte that's in use?

share|improve this question

1 Answer 1

this should do a trick:

// Hide old content types.
$SPContentType.Group = "_Hidden";
$SPContentType.Update();

This will hide ContentType from Site settings but will leave it for all lists and libraries using it in order to save compatibility.

You can find best practices how to manage content types here.

Hope it helps,

Andrew

share|improve this answer

Your Answer

 
discard

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.