Hide file extensions in document name in SharePoint online

Matthew Wolcott 51 Reputation points

I am trying to hide the file extensions of our documents in the Name field in our document library. I've read this post that says you can use JSON, but it will make it so you can no longer click on the name to open it. That wouldn't work for us. Is there any way to do this? It seems like it should be a simple thing. Thank you.


A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,154 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dillon Silzer 52,736 Reputation points

    Hey @Matthew Wolcott

    Please follow the steps to hide the .extensions:

    1: Open your Document Library

    **2: Click the dropdown on the Name Column > Column Settings > Format this Column **


    3: Under Format Columns > Choose Column > Name > Click Advanced Mode

    4: Add the JSON Structure below to the textarea cited from https://social.technet.microsoft.com/Forums/en-US/75cca0ce-a4e2-4428-89d2-dcd998aa9f4f/hiding-file-extension-in-sharepoint-online-document-library?forum=onlineservicessharepoint > Press Save

       "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  
       "elmType": "div",  
       "txtContent": "=if(indexOf('@currentField','.') > 0,substring('@currentField',0,indexOf('@currentField','.')),'@currentField')"  


    The file extensions should now be gone (TestJSON.json is now TestJSON below)



    If this helps please mark as correct answer.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful