Activate publishing feature in SharePoint 2013/2016 using PowerShell
Check out Best Alternative to InfoPath -> Try Now
In this SharePoint 2013 tutorial, we will discuss how to enable or disable SharePoint 2013 publishing feature using PowerShell in SharePoint 2013/2016. Learn how to activate publishing feature SharePoint 2013/2016 using PowerShell. We will also see how to enable the publishing feature in SharePoint 2010.
Here we will first disable the publishing feature and then we will enable the publishing feature in SharePoint.
If you are new to PowerShell SharePoint, read an article on Working with PowerShell in SharePoint Online/2016/2013.
SharePoint 2016 Tutorial Contents
- 1 Enable or Disable publishing features SharePoint 2013 PowerShell
- 2 Activate SharePoint 2013 Server Publishing Feature using PowerShell
- 3 Error while activating SharePoint Server Publishing Feature in SharePoint 2013/2016
- 4 The feature failed to activate because a list at PublishingImages already exists in this site
- 5 Enable publishing features in SharePoint 2010
Now, we will discuss how to enable or disable publishing features in SharePoint 2013/2016 using PowerShell.
Add-PSSnapin “Microsoft.SharePoint.PowerShell”
Get-SPWeb -site http://SiteCollectionURL -limit ALL | ForEach-Object {Disable-SPFeature Publishing -Url $_.Url -confirm:$false}
Get-SPWeb -site http://SiteCollectionURL -limit ALL | ForEach-Object {Disable-SPFeature PublishingWeb -Url $_.Url -confirm: $false}
Get-SPWeb -site http://SiteCollectionURL -limit ALL | ForEach-Object {Enable-SPFeature Publishing -Url $_.Url -confirm:$false}
Get-SPWeb -site http://SiteCollectionURL -limit ALL | ForEach-Object {Enable-SPFeature PublishingWeb -Url $_.Url -confirm: $false}
This section we will discuss, how we can enable the SharePoint 2013 server publishing feature using PowerShell. If within a Site collection if you have multiple subsites, then PowerShell will be very much helpful in activating the Publishing feature in all subsites, we do not need to go to each site and activate from the browser.
Below is the PowerShell command to activate publishing feature in all sites and subsites within a site collection.
$site = Get-SPSite https://SiteCollection URL/
$site | Get-SPWeb -limit all | ForEach-Object {Enable-SPFeature -Identity “PublishingWeb” -Url $_.Url}
$site.Dispose()
Below is the PowerShell command if you want to activate the publishing feature for a particular site.
Individual Site:
Enable-SPFeature -Identity PublishingWeb -URL https://SiteURL/ -Force
Now we will discuss, how to resolve the access denied issue when the user tried to activate or deactivate the SharePoint server publishing feature. The user who was trying to activate was having full control permission is site collection as well as a subsite.
The user was having full control in the subsite as well as in the site collection, but still when the user was trying she was getting access denied.
The user should be a site collection administrator to activate or deactivate the feature on the subsite. Or the user should be a part of “Hierarchy Managers” group for the site collection that contains the subsite.
Then only the user will be activated or deactivate the feature in SharePoint 2013/2016.
The feature failed to activate because a list at PublishingImages already exists in this site
Recently in a migration project, we faced one issue while trying to activate SharePoint 2013 publishing feature in a subsite. The error comes as:
Sorry, something went wrong
The feature failed to activate because a list at ‘PublishingImages’ already exists in this site. Delete or rename the list and try activating the feature again.
TECHNICAL DETAILS
Troubleshoot issues with Microsoft SharePoint Foundation.
Correlation ID: dd9a469d-9e16-a03f-d3a2-794a2716f9d9
The issue basically comes for us in MOSS 2007 to SharePoint 2013 migrated sites. I got two approaches to solve the issue.
First Approach:
We need to go to the PublishingImages library and rename the document library name to some other from the library settings page.
Then try to activate the publishing feature.
Second Approach:
For few subsites the other approach I have tried is I have activated the Publishing feature by using PowerShell command by using the -Force parameter.
The PowerShell command is like below:
Enable-SPFeature -Identity PublishingWeb -URL https://SiteURL/ -Force
We will also see now, how to enable publishing features in SharePoint 2010 sites also,
Before creating any publishing site in your site collection you need to enable publishing feature. If you will not enable then you will get the below error: The Office SharePoint Server Publishing Infrastructure feature must be activated at the site collection level before the Publishing feature can be activated.
So to enable publishing feature to follow below step:
Go to Site Actions -> Site Settings as shown in the figure below:

This will open the Site Settings page. From the Site Settings page go to the Site Actions section and click on Manage Site Features as shown in the figure below.

This will open the list of features and select SharePoint Server Publishing and click on Activate as shown in the figure below.

You may like following SharePoint PowerShell tutorials:
- How to change SharePoint authentication from classic mode to claims based mode in SharePoint using PowerShell
- 3 Different ways to Change Site Collection URL in SharePoint 2013/2016 using PowerShell
- 25+ PowerShell SharePoint Examples
- PowerShell Script to deploy WSP Solution in SharePoint 2013
- Retrieve SharePoint Online List Templates using PowerShell
- [Video Tutorial] How to use Windows PowerShell ISE
- SharePoint 2013 Create Site Column and Content Types Using PowerShell
- [Solved] Current site is not a tenant administration site error in SharePoint Online PowerShell
- SharePoint 2013 backup and restore using PowerShell
- Hide Document Library or Lists using PowerShell in SharePoint 2016/2013
Hope this SharePoint 2013 tutorial explains how to activate publishing feature in SharePoint 2013/2016 using PowerShell. We also learn how to solve The feature failed to activate because a list at ‘PublishingImages’ already exists in this site.

SharePoint Online FREE Training
JOIN a FREE SharePoint Video Course (3 Part Video Series)