2

I am looking for a way to remove / Hide the SHARE Button from the SharePoint Modern page, It would be great if someone can help me with this? any help will be appreciated

Thank youenter image description here

3 Answers 3

1

There is no supported way of removing or hiding it at the moment.
You can control the behaviour of it though, more information on that here.

There is a UserVoice request for the possibility to hide it, you can vote for that feature here:
https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration/suggestions/14343132-provide-an-option-to-disable-the-share-button

1

The workaround is deploy react-script-editor to your tenant so you could hide the share button for specific page by custom CSS.

<style>
button[data-automationid="ShareSiteButton"]{
display:none
}
</style>

OR SPFx Applications Customiser to inject custom CSS

enter image description here

2
  • ReferenceError: primordials is not defined at fs.js:35:5 at req_ (C:\users\tejast\Documents\GitHub\sp-dev-fx-extensions\samples\react-application-injectcss\node_modules\natives\index.js:143:24) at Object.req [as require] (C:\users\tejast\Documents\GitHub\sp-dev-fx-exten Apr 1, 2020 at 7:02
  • I keep getting this reference Error... Apr 1, 2020 at 7:03
0

This CSS did the trick for me:

button[data-automation-id="shareButton"]
    {
        display: none !important
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.