Since we are having issues with copy link, is there any way we can hide it?

enter image description here

enter image description here

This way we forcing users to use Copy document ID only.

2 Answers 2


You cannot hide "Copy link" option from context menu (under ... ellipses menu) in SharePoint online modern experience using OOTB capabilities.

You have to create SPFx extension (Application customizer) to inject custom CSS for hiding this. However, such DOM manipulations are not recommended by Microsoft.

However, you can hide the "Copy link" option from command bar (at the top) using JSON view command bar formatting.

Use below JSON in Format current view option under Switch view options dropdown (where you switch the library views):

    "commandBarProps": {
        "commands": [
                "key": "copyLink",
                "hide": true


enter image description here


We could use SharePoint Json formatting to hide some command bar buttons.

Supported buttons:


Tested json for your reference:

  "commandBarProps" : {
    "commands": [
        "key": "copyLink",
        "hide": true

Document Link:https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting

The another 'Copy Link' button you may need to use SPFX extension to inject CSS to hide it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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