SUM it up: Avoid the Ugly SharePoint URL

Posted by: Joy T. Apple on February 21,2017


Working inside a web-based environment brings a few changes to the way we work with our files and documents. One of the most visibly noticeable things we see when working in SharePoint is the URLs. Almost everything in SharePoint has its own URL or Uniform Resource Locator. A URL basically acts as an address (web address) for items we can browse to on the internet. 

folder icon.pngLet’s say I work at an Awesome Company and I have a document named “SharePoint Best Practices for Working in Document Libraries” that I need to upload to our Great Documents library. If I use that long title for a filename, I’ll get something like this: SharePoint%20Best%20Practices%20for%20Working%20in%20Document%20Libraries.docx. 

That’s a little long, and what’s with the “%20” between all the words in the document name? Keep in mind, we’re placing the document inside of a site collection. This means we are going to automatically have the web application name (AwesomeCompany), site collection and possibly subsite names (GreatSite) included in the URL. In our example, the URL we are working with is on the top level site so there is no sub site name. Also we need to remember that SharePoint interprets spaces as “%20.” Anywhere we have a space in a site, list/library or item name, SharePoint will insert the dreaded “%20.”  

“Ok,” you say, “That’s good to know but why should I care? I don’t usually pay a lot of attention to URL’s. Why does it matter if they don’t look good? That’s fine; about 80% of users don’t really look at the addresses as they’re moving about inside of SharePoint.

The reason why you should care is this: SharePoint has a URL character length limit of 256 characters.

If the full path (URL) exceeds this limit SharePoint can’t find the object. Shortcuts, e-mailed links, and/or navigational buttons won’t work.  Search won’t be able to find those deeply buried pieces of content and if we need to restore from backup, well… guess what won’t be restored.  The index will have records that content exists but will be unable to crawl or index it. Users can use the URL to figure out where the document, site or list/library is but that can be tedious and slow, not to mention frustrating 

256 sounds like a lot but in reality, it’s not. If we use the same methods to name our content in SharePoint as we did on our file shares, we will hit that limit pretty fast. In file shares the more explicit we are with names, the better. I’ve seen file names in shared drives with dashes, slashes, asterisks, the author’s name, date and revision. And you know how Word and other office applications are kind enough to name our documents for us? If we aren’t paying attention we end up with a name that’s almost the whole first sentence of the document. All of this gets appended to the entire path to the document and it adds up fast. Especially if we fail to embrace views and choose to bury our content inside of a deep folder structure. Every folder name is another section in our URL.  

So, how do we name our sites, lists, libraries and sites in SharePoint so that the names are short but still make sense? 

Might I suggest CamelCase? CamelCase is the naming convention of writing compound words or phrases without spaces, 220px-CamelCase.svg.pngcapitalizing the first letter of each new word.  We can take “SharePoint Best Practices for Working in Document Libraries”, simply remove the spaces and use ”SharePointBestPracticesforWorkinginDocumentLibraries. This assumes we are really stuck on using the entire name. In the real world, I’d name it something like DocBestPractices or even DocLibBPs.

CamelCase gives us better reference than all lower case without the need for spaces which will clutter up our URLs with %20. I could then use that full name in the title field. The title column isn’t used as the URL, it can be as long as we want it to be and chose to display it in our library views or not. Either way, it’s metadata that Search will relate to our document. I could also choose to use pieces of the title as metadata and create columns to capture that data. Think of a column called Category and my metadata from the title would be SharePoint. Whichever way we choose to go we’re keeping the URL short and using all those awesome words as searchable and findable metadata 

Speaking of metadata:

One of the best features of SharePoint for file management is the ability to apply metadata to our files, documents and list items. Leveraging metadata fields (columns) in our lists and libraries eliminates the need to include things such as author names, revisions and dates in file names. Simply use the built in columns that SharePoint provides or create your own custom columns. Not only will this help us dramatically shorten our URLs, it makes search more efficient and relevant and we can then use those columns to sort and filter our lists and libraries. It’s a Win/Win! 

I mentioned revisions above so let’s discuss it briefly. SharePoint already has this feature built in, so creating column to track revisions or using revision numbers in names isn’t necessary. By using the Versioning features you can monitor, track and surface drafts and revisions of documents throughout their lifecycle. Document owners can see which files are in draft mode, which are Approved and how many times they’ve been edited. We can even look at those old edits and restore back to them if needed. Views can then be configured to display all or some of this information, as needed.  

Let’s recap: 

SUM it up! URLs need to be Short, Unique and Meaningful. 

  • CamelCase is your friend!
    • MyFaveDoc is a little easier to tread then myfavedoc.
    • It gives us better reference than all lower case
    • No spaces means no dreaded %20.  
  • Don’t use Version, Draft or Revision in the Filename. SharePoint can handle that for you.  
  • Views can then be configured to display information as needed based on the metadata provided.

Topics: SharePoint, sharepoint document naming, sharepoint document naming conventions, sharepoint document naming best practices, SharePoint URL, SharePoint URL Length Limits

Subscribe Today!

Recent Posts