How to Customize File and Folder Sorting in SharePoint Libraries
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.
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.
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.
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').
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.
Click the view dropdown menu in the top right corner (usually labeled 'All Documents') and select 'Edit current view'.
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.
Submit a Feature Request via the Feedback Portal
If applying metadata does not meet your business requirements and you strictly need prefix-based sorting, you can formally request this feature from Microsoft.
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. 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. Open your existing files: Launch WPS Office and directly open your synced SharePoint or local Office files without worrying about format conversion.
- 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.

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.




