Here we will discuss how we can remove items from the Site Actions menu using JavaScript object model (jsom) in SharePoint Online Office 365. In my previous posts, we have discussed how we can add an item to the Site Actions menu in SharePoint online Office 365 using JavaScript object model (jsom).
New to Office 365 SharePoint Online? Get Office 365 Enterprise E3 Subscription & Try out all the features
Here in my SharePoint online site, I have added few items to the Site Actions menu like below:

Also, read:
– SharePoint Online Site Workflow and Initiation Form Parameters example using SharePoint designer workflow
– Introduction to cloud computing and Microsoft Azure
– Create Custom Action Group using Visual Studio 2015 for SharePoint 2016
We can add the below jsom code inside a script editor web part which we can add into a web part page.
Below is the full code
<script language=”javascript” type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js”></script>
<script language=”javascript” type=”text/javascript”>
var customActions;
var clientContext;
$(document).ready(function() {
SP.SOD.executeFunc(‘sp.js’, ‘SP.ClientContext’, DeleteCustomMenuAction);
});
function DeleteCustomMenuAction() {
clientContext = new SP.ClientContext();
var web = clientContext.get_web();
customActions = web.get_userCustomActions();
clientContext.load(customActions);
clientContext.load(web);
clientContext.executeQueryAsync(OnSuccess, OnFailure);
}
function OnSuccess() {
var enumerator = customActions.getEnumerator();
var removeThese = []
while (enumerator.moveNext()) {
var action = enumerator.get_current();
alert(action.get_title());
if (action.get_title() == “Go to EnjoySharePoint”)
{
action.deleteObject();
}
clientContext.load(action);
clientContext.executeQueryAsync();
}
}
function OnFailure() {
alert(‘Fail’);
}
</script>
Once you add the code and execute, the menu items will be removed from the Site Actions menu.

SharePoint online Remove items from the Site Actions menu using JavaScript object model
Hope this will be helpful.