Remove content type from “New” item options?
-
10-12-2019 - |
Question
I need to migrate some values into SharePoint that would have useless values for our system going forward. I'm using a content type called "Old Request" solely so that they can have different columns and clearly be identified as such. I want to have "New Request" and "Old Request" within the same list, but I don't my users to be able to create a "New Old Request" for obvious reasons :)
Is this possible?
Solution
You can make the content type hidden by using PowerShell: Example:
$web = Get-SPWeb -Identity http://aissp2013:111
$list = $web.Lists["TestList"]
$list.ContentTypes["TestCT"].Hidden = $true
$list.ContentTypes["TestCT"].Update()
UPDATE
However, the above code or the steps given by @Robert will not hide Content Type dropdown from Edit page. That can be done by placing a script in Content Editor web part:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
// Hides the entire table row from the EditForm.aspx
$('select[id*="Content Type"]').parent().parent().hide();
});
</script>
OTHER TIPS
In the Document Library (or List) settings:
- Under the section "Content Types" click "Change new button order and default content type"
- Uncheck "Visible" for the Content Type you want to hide
- Click OK
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange