Content Editor and Script Editor Web Part missing in SharePoint Online Root Site Collection

In my SharePoint Online Root Site Collection, I couldn’t see the Content Editor and Script Editor web part. I followed below steps and then I was able to see these 2 web parts immediately:

1- Make sure you are the Global Administrator and Local Administrator of office 365 and your local machine (as we will be running SharePoint Online Management Shell as Administrator)

2 – Log in to Office 365

3 –  Go to your Root Site Collection (https://abc.sharepoint.com) and under Site Settings activate below:

Site Settings -> Site Actions -> Manage Site Features -> SharePoint Server Publishing (Activate it)

Site Settings -> Site Collection Administration -> Site collection features -> SharePoint Server Publishing Infrastructure (Activate it)

4 – You need to enable Custom Scripts as well on your Site Collection, which can be done through your SharePoint Admin Portal -> Settings ->Custom Script

Prevent users from running custom script on personal sites
 Allow users to run custom script on personal sites

 Prevent users from running custom script on self-service created sites
 Allow users to run custom script on self-service created sites

This will take effect in 24 or 48 hours.

OR

you can run below script to activate it immediately (i ran the below script)

$adminUPN=”sumayya.aslam@abc.com”
$orgName=”abc”
$userCredential = Get-Credential -UserName $adminUPN -Message “Enter password”
Connect-SPOService -Url https://abc-admin.sharepoint.com -Credential $userCredential
Set-SPOsite https://abc.sharepoint.com -DenyAddAndCustomizePages 0

After you follow the above procedure, then you should see Content Editor and Script Editor web part under Media and Content on the Root Site Collection.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.