Disable Footer on Communication site and subsites


You can remove the footer by interface but you need to remove one by one. This example is when you have a template of a Modern Communication site applied to sub-sites. With PNP PowerShell, we can disable all the Footers from the Communication site.

I have a previous post, where I’ve created a similar PowerShell to deactivate the theme on all the Communication sites, but will not get the footer disabled on subsites. For more information about that PowerShell script check the next link.

$loginUrl   = "https://contoso.sharepoint.com/sites/SITENAME/" #SharePoint site
$username   = "contoso@contoso.com"
$password   = "password"

$encpassword = convertto-securestring -String $password -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $encpassword

Connect-PnPOnline -Url $loginUrl -Credentials $cred
$web = Get-PnPWeb 
$web.FooterEnabled = $false
$web.Update()
Invoke-PnPQuery
Write-Host "Footer Disable on " $loginUrl

$subsites = Get-PnPSubWebs -Includes "WebTemplate","Configuration"
foreach ($site in $subsites){
 $sitesTemplate= $site.WebTemplate + "#" + $site.Configuration
  if ($sitesTemplate -eq "SITEPAGEPUBLISHING#0"){
   Connect-PnPOnline -Url $site.url -Credentials $cred
   $web = Get-PnPWeb 
   $web.FooterEnabled = $false
   $web.Update()
   Invoke-PnPQuery
   Write-Host "Footer Disable on " $site.url
  }
}

Conclusion

After you run this PowerShell script all the sub-site of that particular site collection will be disabled.

3 Comments

  1. mgmjtech said:

    how do I check if the footer is enabled or disabled?

    May 30, 2019
    Reply
    • David Ramalho said:

      Hi, When you’re in a Communication site, at the bottom of the page you’ll see the footer. If it is deactivated, you can’t see it unless you reactivate it on change the look.

      June 2, 2019
      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *