Best practice: file naming for the web

Best practice: file naming for the web

I hope this will help other web content managers and editors understand URL structures, page names, and file naming conventions, if they don’t already. I have this conversation at least once a week at work, and while I’m a patient wee soul, I thought I’d document it just in case it’s useful for anyone else so we can move on and talk about other things like BTS or coffee.

Following these file naming practices will ensure a better user experience, search engine optimisation, and long-term content management efficiency.

Understanding URLs and page names

Every item on the internet has a unique address called a Uniform Resource Locator (URL). Think of a URL as an address for digital content. Whether the file is an image, a PDF, a video, a webpage, or any document – if it's available on the internet, it has its own unique URL.

These digital addresses help web browsers locate exact content. When you type a domain into your browser's address bar, the URL directs your computer to that specific location on the internet.

If content is moved, renamed, archived, or deleted from its original location, the URL will no longer work. This results in a '404 Error' message, meaning 'file not found' – the browser followed the URL's directions, but the item wasn't there anymore.

This is why maintaining consistent URLs is critical, especially for important pages – changing them without proper redirects would be like changing a physical address without telling anyone!

Components of web content naming

Websites typically refer to content names in different contexts:

  • Page title – appears on the published page

  • URL segment or file name – appears in the URL in the browser address bar

  • Navigation label – appears in menus and breadcrumbs on the website, and depending on the Content Management System (CMS) you are using, it can be the name off the page in the site tree of the CMS.

When a new page is created, content management systems often automatically generate a URL segment based on the page name. These automatic URLs are frequently longer than necessary and should be edited for clarity and conciseness.

URL segment and file name conventions

Follow these best practices when creating URL segments and file names:

Use lowercase letters and numbers only

URLs should use lowercase alpha-numerical characters to avoid confusion or errors.

  • Good: about-us

  • Avoid: About-Us

Use hyphens between words

Hyphens are the preferred method for separating words in URLs. They improve readability and are better understood by search engines.

  • Good: team-members

  • Avoid: teammembers or team_members

Create readable URL segments

Ensure that URL segments are readable and make sense in the context of the entire URL. This helps both users and search engines understand your content.

  • Good: domain.com/services/web-design

  • Avoid: domain.com/s/wd

Keep segments concise

While it's important to be descriptive, keep URL segments as short as possible without losing clarity.

  • Good: domain.com/contact

  • Avoid: domain.com/contact-us-form-page

Maintain consistency

Use a consistent URL structure across your website to ensure a cohesive user experience.

Avoid spaces

Spaces in URLs can cause technical issues. Use hyphens instead to maintain readability.

  • Good: annual-report

  • Avoid: annual report

Don't use underscores

While underscores are technically allowed, they're not recommended because they can be harder to read, especially when URLs are shared. Hyphens are more SEO-friendly.

  • Good: marketing-strategy

  • Avoid: marketing_strategy

Avoid dates in URLs

Don't include dates or years in the URL segment unless essential to the content structure. By avoiding dates, the same URL can be used year after year without needing to be changed or redirected.

  • Good: domain.com/events/annual-conference

  • Avoid: domain.com/events/2025-annual-conference

Best practices for web file names (pages and documents)

  1. Check for duplicates: Before creating a new file name, check if it already exists in your section or folder.

  2. Be descriptive and concise: File names need to clearly communicate content while making sense in context. Document file names should be meaningful when searched on a computer, server or website.

  3. Avoid dates or years: Adding a date to your file name shortens its usability and increases maintenance work.

  4. Use lowercase letters and numbers only: This is a critical convention. Don't run words together, use underscores, capital letters, or special characters.

  5. Replace spaces with hyphens: File names cannot have spaces, so add hyphens for human readability.

  6. Include relevant keywords: Use important terms associated with your file, but don't overdo it.

  7. Front-load file names: Place the most distinctive part of the name first.

    • Good: prospectus-auckland.pdf

    • Avoid: auckland-uni-prospectus.pdf

Updating files

When replacing files online, maintain the same file name rather than creating new ones with different names. For example:

Instead of uploading sustainability-report-2025.pdf to replace report-2024.pdf, update the content while keeping the sustainability-report.pdf

This practice:

  • Preserves all existing links and good Google-juice

  • Prevents broken links from bookmarks or external websites

  • Eliminates the need to update references across multiple platforms

  • Saves considerable time in maintenance

Before making URL changes

Before unpublishing, archiving a live page, or changing a URL segment on a published page, consider setting up proper redirects. This prevents visitors from encountering 404 errors and guides them to relevant alternative content, ensuring a smooth browsing experience.

This also applies to PDFs and other files that have been linked on published web pages.

By following these practices, you can create URL segments and file names that are easy to read, SEO-friendly, and enhance the overall user experience on your website while minimising maintenance work.

Cover photo "This is the sign you've been looking for" by Austin Chan on Unsplash
Once upon a time...

Once upon a time...