Remove or hide Replace It button from file upload dialog box in SharePoint Online/2013/2016

How to remove or hide Replace It button from file upload dialog box in SharePoint 2019?

This SharePoint customization tutorial explains how we can hide the “Replace It” button from the “A file with the same name already exists” dialog box in SharePoint Online Office 365 site using CSS

If you are adding any document to a SharePoint document library which already exists then it will show a dialog box with two buttons like “Replace It” and “Don’t Upload”.

SharePoint deveopment training course

Here our requirement was to hide Replace It button so that no one can replace a file which already exists in the document library. The dialog box looks like below:

Remove or hide Replace It button from file upload dialog box in SharePoint Online/2013/2016
Remove or hide Replace It button from file upload dialog box in SharePoint Online/2013/2016

Hide Replace It button from file upload dialog box in SharePoint

We can hide Replace It button by using css in SharePoint.

Edit the page and add a script editor web part to the document library page. Add the below code and Save the page.

<style type=”text/css”>
#ms-conflictDlgReplaceBtn {
display:none;
}
</style>
remove Replace It button from file upload dialog box in SharePoint
remove Replace It button from file upload dialog box in SharePoint

Now when you will try to upload a file which already exists, it will display the dialog box which will have “Don’t Upload button” like below:

hide Replace It button from file upload dialog box in SharePoint
hide Replace It button from file upload dialog box in SharePoint

You may like following SharePoint CSS tutorials:

Hope this SharePoint tutorial, explains how can we remove or hide Replace It button from file upload dialog box in SharePoint Online or SharePoint 2013/2016.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →