Publish Content Type in SharePoint using PowerShell

Content types that we create in one SharePoint site collection should be published from Managed metadata content type hub in order to make the content type available in all other site collections which consume Managed Metadata Service application.

How to publish from content type hub in SharePoint 2013?
To publish a content type from the content type hub site in SharePoint, browse to your content type hub site collection, Navigate to:
  • Site Settings >> Site Content Types 
  • Select the content type that you would like to publish. 
    how to publish content type hub in sharepoint 2013
  • In content type settings page, click on "Manage publishing for this content type" link.
  • From this page, you can publish a content type by selecting "Publish" and clicking on "OK".
    publish content type sharepoint 2013 powershell
Also, If you make any changes to an existing published content type in content type hub site, you should republish the content type for the changes to take effect. Likewise, if you no longer want your content type to be available, you can unpublish the content type. (unblishing will not remove the content type in use from a subscriber sites). All published content types become available in site collections of consuming web application after the content type hub and content type subscriber timer jobs run.

How to push changes from Content Type Hub to Site Collections immediately:
Once the content type is published it may take up to an hour for the subscribing Site Collections to get it. This is internally done by a timer job called "Content Type Subscriber" that is scheduled to run once an hour. To publish a content type and want to see them in your site collections immediately on-demand, go to:
  • Central Administration >> Monitoring > Review Job Definitions 
  • Pick the "Content Type Subscriber" job of your target web application and click on Run now 
  • Now, your content type should be available for use in subscribed sites.
    sharepoint powershell publish content type
Publish content type SharePoint 2013 using PowerShell
If the content type publishing activity is too frequent and repeating, we can automate it with PowerShell. Lets publish the content type in SharePoint using PowerShell.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

# Function to publish the content types
Function Publish-ContentType($HubSiteURL, $ContentTypeName)
    #Get the objects from Parameters
    $HubSite = Get-SPSite $HubSiteURL
    $ContentType = $HubSite.RootWeb.ContentTypes | Where {$_.Name -eq $ContentTypeName}

    #Check if the content type exists
    if($ContentType -ne $null)
        #Create a new content type publisher 
        $Publisher = New-Object Microsoft.SharePoint.Taxonomy.ContentTypeSync.ContentTypePublisher($HubSite)

        Write-Host "Published Content Type $ContentTypeName" -foregroundcolor Green
         Write-Host "Content Type $ContentTypeName Not Found!"  -ForegroundColor Red

#Configuration Parameters
$ContentTypeName="Sales Proposal v.1"

#call the function to publish content type
Publish-ContentType $HubSiteURL $ContentTypeName

How about Publishing all Content Types from a Content Type Group?
Here is the SharePoint PowerShell to publish content type. 
#Configuration Parameters
$ContentTypeGroup="Crescent Templates"

#Get the content type hub
$HubSite = Get-SPSite $HubSiteURL

#Publish each content type from the group
$HubSite.RootWeb.ContentTypes | where { $_.Group -match $ContentTypeGroup } | ForEach-Object {
   Publish-ContentType $HubSiteURL $_.Name 

To Trigger the Timer job using PowerShell:

#Run the Content Type Subscriber timer job for a specific Web Application
$CTypeSubscriberTimerJob = Get-SPTimerJob "MetadataSubscriberTimerJob" -WebApplication $SubscriberWebAppURL


  1. Hello Salaudeen,

    This is really good. Thank you.

    I wanted to find out if there is a script to publish ALL the content types and not just by groups.


    1. Just remove the "Where" part.
      Instead of:

      $HubSite.RootWeb.ContentTypes | where { $_.Group -match $ContentTypeGroup } | ForEach-Object {
      Publish-ContentType $HubSiteURL $_.Name


      $HubSite.RootWeb.ContentTypes | ForEach-Object {
      Publish-ContentType $HubSiteURL $_.Name

  2. Hello Salaudeen,

    Thank you for this great script.

    I wanted to find out if there is a script to publish the content types for SP online using Powershell?


  3. Is there a way to stop the republishing? We accidentally hit the "Refresh all published content type" at the site collection level and we want to stop it. We disabled the content subscriber job in the mean time but getting it out of the queue would be what we need.


Please Login and comment to get your questions answered!

Powered by Blogger.