logo
search
SharePoint Document Issues

How to Customize File and Folder Sorting in SharePoint Libraries

Maira MehtabMaira Mehtab Sep 28, 2026 869 views

Question details

The user wants to apply custom sorting to files and folders in a SharePoint document library, specifically aiming to place files with specific prefixes before all other items while keeping their original names.

Product
SharePoint
Device & OS
not provided
Scenario
Organizing and ordering files and folders within a SharePoint document library to meet specific business display requirements.
Observed behavior
SharePoint natively lacks the ability to prioritize specific file prefixes before folders and other files in the default sort order without altering the original file names.
Before you start

Ensure you have the necessary site or library permissions (such as Edit or Design access) to create new metadata columns and modify the default views in your SharePoint document library.

Solution 1Recommended

Use Metadata and Custom Views for Sorting

Since native custom prefix sorting is not supported, adding a custom metadata column allows you to categorize and precisely control the display order of your files and folders.

SharePoint relies heavily on metadata rather than traditional folder hierarchies and file name prefixes. By creating a custom column, you can assign a priority value to specific files, allowing you to sort them exactly how you need without changing the actual file names.

1
Add a new custom column

Navigate to your SharePoint document library, click on 'Add column' at the top of the document list, and select 'Choice' or 'Number' (e.g., name it 'Display Priority').

2
Assign metadata to your files

Select the files you want to appear first, open the details pane, and assign them a high priority value or specific category in your new column.

3
Edit the current library view

Click the view dropdown menu in the top right corner (usually labeled 'All Documents') and select 'Edit current view'.

4
Apply the new sorting criteria

Scroll down to the 'Sort' section, select your newly created custom column from the 'First sort by the column' dropdown, choose ascending or descending order, and click 'OK' to save.

Tip: You can also use the 'Group By' feature in the view settings to group your priority files at the top of the library, visually separating them from the rest of the folders and documents.
Free Microsoft Office alternative

Manage Your Documents Effectively with WPS Office

While cloud platforms like SharePoint have specific sorting limitations, managing and editing your local documents is seamless with WPS Office. WPS Office provides a highly compatible, lightweight alternative to Microsoft Office, allowing you to effortlessly organize, edit, and save your documents in a familiar desktop environment without complex sorting restrictions.

  1. 1. Download and install: Visit the WPS Office website to download the free installer and complete the setup on your Windows, Mac, or Linux device.
  2. 2. Open your existing files: Launch WPS Office and directly open your synced SharePoint or local Office files without worrying about format conversion.
  3. 3. Manage and edit seamlessly: Use the built-in tabbed interface and lightweight document manager to easily navigate and edit your files in the order you prefer.
Fully compatible with Microsoft Office document formats (.docx, .xlsx, .pptx).Tabbed document viewing makes it easy to organize and switch between multiple files.Lightweight installation with extremely fast loading times.Free to use with a familiar, intuitive user interface that requires no learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Can I force SharePoint to display files before folders by default?

By default, SharePoint groups folders at the top of the library. To change this, you must edit the library view, scroll to the 'Folders' section, and select 'Show all items without folders', which presents a flat list of all files regardless of their folder location. You can then sort them by name or metadata.

Why does Windows File Explorer sort special characters differently than SharePoint online?

SharePoint Online and Windows File Explorer utilize different sorting algorithms. SharePoint online relies on a specific web-based alphanumeric sorting logic, which means prefixes like underscores or symbols might not enforce the exact same display order as they do on a local Windows machine.

Is it possible to manually drag and drop files to rearrange their order in a SharePoint library?

No, SharePoint document libraries do not support manual drag-and-drop reordering. The order of items is strictly controlled by the active view's sorting settings and the underlying column data.