Website Folders: A Tour Simplify Web Design Best Practice: Organize!

By Benjamin

A well-organized website folder structure is not just about aesthetics; it's a crucial factor in site performance, accessibility, and search engine crawability. Just like a library, a logical folder structure helps users and search engines navigate your website effectively. Let's dive into a practical example of a well-structured website folder.

Setting up Folder Structure – First step to BIM
Setting up Folder Structure – First step to BIM

Before we delve into the specifics, remember that a good folder structure should be clean, hierarchical, and relevant. It should mirror your website's content and allow users to understand where they are and where they can go next.

A HTML and CSS Website Folder Structure
A HTML and CSS Website Folder Structure

Root Folder Structure

The root folder is the top-level directory where all your website files reside. It should contain only the necessities to keep your site running smoothly.

a purple background with yellow dots and the words folder structure on top of each one
a purple background with yellow dots and the words folder structure on top of each one

For instance, in a basic WordPress site, you might have the following in your root folder:

  • index.php - The main file that PHP processes to fetch and display the content of your website.
  • wp-admin, wp-includes, wp-content - Folders crucial to WordPress' functioning.
  • license.txt, readme.html, wp-activate.php, etc. - Essential WordPress files and folders.
A Website Design Folder Structure
A Website Design Folder Structure

www or public_html Folder

To host a website directly in the root of your domain, you might use a folder named 'www' or 'public_html'. All your website files should be within this folder.

For example:

two screens showing the different types of water and landforms, with text below them
two screens showing the different types of water and landforms, with text below them
  • /www
    • /index.html
    • /css, /js, /img - folders for your website's stylesheets, scripts, and images.
    • /fonts - for custom fonts.

htdocs Folder

Some hosting providers require the root folder of your website to be named 'htdocs'. In this case, your folder structure would look like this:

Our Project Folder Structure for Efficient Shopify Builds
Our Project Folder Structure for Efficient Shopify Builds

/htdocs

  • /index.html
  • /css, /js, /img - folders for your website's stylesheets, scripts, and images.
  • /fonts - for custom fonts.

Organizing Your Website's Content

The Best Way to Organize Marketing Assets With Simple Folder Structures
The Best Way to Organize Marketing Assets With Simple Folder Structures
Flutter Folder Structure
Flutter Folder Structure
Site Collections, Sites, Pages, Document Libraries, and Folders - putting it all together | SharePoint Maven
Site Collections, Sites, Pages, Document Libraries, and Folders - putting it all together | SharePoint Maven
Folder Structure - Dragonframe - Help Wiki
Folder Structure - Dragonframe - Help Wiki
a family tree is shown in this diagram
a family tree is shown in this diagram
an image of a business organization chart
an image of a business organization chart
How to organize your design/creative resources folder
How to organize your design/creative resources folder
Cloud Drive Folder Structure Plan | Creately
Cloud Drive Folder Structure Plan | Creately
Transform Your Digital Life with Tidy Haus Organizing
Transform Your Digital Life with Tidy Haus Organizing
What is your file naming convention you use for version control?
What is your file naming convention you use for version control?

Now that we have the basics covered, let's look at organizing your content in folder form.

Content folders should be named clearly and intuitively, reflecting the content within. Use lowercase letters and hyphens to separate words (e.g., /about-us instead of /AboutUs).

Blog Posts

A common structure for blog posts is to have a 'posts' folder, with each post in a separate file. For instance:

/posts

  • post-title-1.html
  • post-title-2.html
  • ...

Categories and Tags

For better organization, consider having separate folders for categories and tags:

/categories

  • /technology
    • /post-title-1.html
    • /post-title-2.html

  • /travel
    • /post-title-3.html
    • /post-title-4.html

  • Repeat this structure for 'tags' folder.

    Multimedia Files

    Audio and video files can be organized into separate folders or within the relevant content folders.

    For instance:

    /media

    • /audio - for podcasts or background music.
    • /video - for promotional videos or tutorials.

    Always remember, the key to a good folder structure is consistency, clarity, and logical hierarchy. Keep it simple, and make sure it mirrors how you would navigate your website.

    Lastly, keep in mind that search engines also navigate websites by crawling these folders. A well-structured folder system can significantly enhance your site's crawlability and, consequently, its SEO performance.

    So, go ahead and organize your website folders today, and watch as your site becomes more accessible, user-friendly, and search engine-friendly. Happy structuring!