WordPress Basics

How to Create a Directory in WordPress

Step-by-Step Guide to Safely Creating Folders on Your WordPress Server

Need a place to store downloads, custom scripts, or other assets for your WordPress site, but not sure how to create a new folder on your server? It’s normal to feel nervous about touching anything outside the WordPress dashboard—one wrong move in the file system can take your site offline.

The good news is that creating a directory (folder) for WordPress is straightforward when you do it in the right location and with the right tools. In this guide, you’ll learn how to create a directory safely using cPanel File Manager, an FTP (or SFTP) client, and SSH/WP-CLI, so your site stays online and secure—no matter which theme (including Jannah) or editor you use.

If you’re completely new to WordPress, you may want to skim our WordPress guides and tutorials overview first, then come back here when you’re ready to work with your hosting account.

Prerequisites

Before you create a directory for your WordPress site, make sure you have the basics in place. You don’t need to be a developer, but you should be comfortable logging into your hosting account.

  • An existing WordPress site installed on your hosting account.
  • Login access to your hosting control panel (often cPanel or a similar interface).
  • (Optional) FTP/SFTP credentials from your host (hostname, username, password, port).
  • (Optional) SSH access if you plan to use WP-CLI or command-line tools.
  • A recent backup of your site files and database, in case you need to roll back.
Note: If you manage multiple domains on the same hosting account, double-check you’re working in the correct site’s folder before you create anything.

Step 1: Understand the WordPress Directory Structure

Before you create a directory, you need to know where WordPress keeps its core files and where it’s safe to add your own folders. Almost all WordPress installations share the same basic structure in the site’s root (often public_html or a subfolder):

  • wp-admin/ – Core admin dashboard files (do not modify).
  • wp-includes/ – Core WordPress libraries (do not modify).
  • wp-content/ – Themes, plugins, uploads, and other custom assets.
  • wp-content/themes/ – Your theme and child theme directories.
  • wp-content/plugins/ – Your plugin directories.
  • wp-content/uploads/ – Media uploads managed by WordPress.

In most cases, you should create new directories inside wp-content/, because that’s where WordPress expects non-core files to live. For example, you might create wp-content/custom-downloads/ or wp-content/my-scripts/ for custom assets.

Warning: Never create, rename, or delete directories inside wp-admin or wp-includes unless you know exactly what you’re doing. Changing these core folders can break your WordPress installation.

Step 2: Create a Directory with cPanel File Manager

Using cPanel’s File Manager is often the simplest way to create a directory for your WordPress site. Everything happens in your browser—no extra software required.

  1. Log in to your hosting control panel.
    Open your host’s dashboard and click into cPanel (or the equivalent file manager interface).
  2. Open File Manager.
    In cPanel, click File Manager. A new tab will open showing your server’s files.
  3. Locate your WordPress root folder.
    This is commonly public_html, but it might also be a subdirectory like public_html/blog or example.com/public, depending on your host.
  4. Navigate to the safe area for new directories.
    Double-click into your WordPress folder, then into wp-content/. Decide where your folder should live (for example, directly inside wp-content/ or inside wp-content/uploads/).
  5. Create the new folder.
    Click the + Folder button (top menu in File Manager). A pop-up will ask for the folder name and location.
  6. Name your directory.
    Use lowercase letters, numbers, and hyphens or underscores (no spaces). Examples:

    • custom-downloads
    • landing-page-assets
    • tracking-scripts
  7. Confirm the path.
    Make sure the path is correct (for example, /public_html/wp-content/custom-downloads), then click Create New Folder.
  8. Verify your directory.
    In the left folder tree, you should now see your new folder listed under wp-content/. Click it to confirm it’s empty and ready to use.
Pro Tip: If you’re organizing downloadable files, consider creating folders like wp-content/downloads/ebooks/ or wp-content/downloads/plugins/ so everything stays grouped logically over time.

Step 3: Create a Directory via FTP or SFTP

If your host doesn’t offer cPanel, or you prefer to manage files from your desktop, you can create directories using an FTP or SFTP client (such as FileZilla or Cyberduck). This is especially useful for developers or agencies managing many sites.

Not sure which program to use? Check out the best FTP clients for WordPress users to pick a tool that fits your workflow and operating system.

  1. Gather your FTP/SFTP credentials.
    You’ll need:

    • Server/host name (e.g., ftp.yoursite.com or your server IP).
    • Username and password (provided by your host).
    • Port (21 for FTP, 22 for SFTP, unless your host specifies otherwise).
  2. Connect to your server.
    Open your FTP client, create a new connection using the credentials above, and connect to the server.
  3. Navigate to your WordPress directory.
    In the remote site panel, browse to your site’s root folder (for example, /public_html or /sites/example.com), then into wp-content/.
  4. Create the new directory.
    Right-click inside wp-content/ (or your chosen location) and select Create directory or Create folder. Enter a descriptive name, such as custom-downloads, and confirm.
  5. Check permissions.
    Many FTP clients let you view permissions by right-clicking the folder and choosing File permissions. Typical directories use 755 permissions; your host may enforce this automatically.
  6. Test the directory.
    Upload a small test file (like test.txt) into the new folder to confirm you can read and write to it. You can later delete this test file.
Note: Whenever possible, use SFTP (SSH File Transfer Protocol) instead of plain FTP. SFTP encrypts your login and file transfers, which is much safer for your WordPress site.

Step 4: Create a Directory Using SSH and WP-CLI (Advanced)

If you’re comfortable with the command line, creating directories via SSH is faster and easier to automate. While WP-CLI itself doesn’t have a dedicated “create directory” command, you can use standard shell commands alongside WP-CLI for advanced workflows.

  1. Connect to your server via SSH.
    Use an SSH client (like Terminal on macOS/Linux or PuTTY on Windows) and connect with the SSH credentials from your host.
  2. Change to your WordPress root folder.
    Run something like:

    cd /home/username/public_html

    Adjust the path to match where WordPress is installed on your server.

  3. Create the directory inside wp-content.
    mkdir wp-content/custom-downloads

    Replace custom-downloads with a name that matches how you plan to use the folder.

  4. Set appropriate permissions.
    chmod 755 wp-content/custom-downloads

    This is a common permission setting for directories on Linux-based web servers.

  5. Verify the directory.
    ls -ld wp-content/custom-downloads

    You should see a line showing the folder, its permissions, and its owner.

Warning: Double-check your current directory with pwd before running commands like mkdir or rm. A typo in the path can create folders in the wrong location—or delete the wrong files.

Step 5: Use Your New Directory Safely in WordPress

Creating the directory is only half the job. You also need to use it in a way that keeps your site organized, fast, and secure.

Common safe uses for a custom directory include:

  • Storing downloadable assets (PDFs, ZIP files, documentation) for your visitors.
  • Keeping custom scripts or tracking pixels separate from your theme files.
  • Saving logs or exports generated by a plugin that lets you choose a directory.

If your directory will be accessible from the web, you should disable automatic directory listing so visitors can’t see a raw list of every file inside. On Apache-based servers, you can do this by adding a small .htaccess file inside the folder:

Options -Indexes

For folders that should never be publicly accessible (for example, log files or temporary exports), your developer or host can apply stricter rules, such as blocking all direct access to that directory.

Once you’re confident your directory is set up correctly, consider reviewing your broader security posture. A good starting point is to follow a dedicated hardening checklist to help you secure your WordPress website beyond just file management.

Confidently Creating Directories in WordPress

Creating a new directory for your WordPress site doesn’t have to be risky or confusing. By working inside wp-content/, using tools like cPanel File Manager, FTP/SFTP, or SSH, and keeping clear naming conventions, you can keep your custom files organized without touching fragile core folders.

As you build out more features—whether it’s a download library, custom scripts, or plugin exports—use these same principles: work in the right location, keep backups, and test changes on a staging site before rolling them out to your live WordPress installation.

Further Reading

Frequently Asked Questions

Can I create a directory directly from the WordPress dashboard?

In a standard WordPress installation, there’s no built-in option in the dashboard to create arbitrary folders on the server. Some file manager plugins add this capability, but it’s usually safer and more reliable to use your hosting File Manager (like cPanel) or an SFTP client. Those tools work at the server level, so they don’t depend on WordPress being fully functional.

Why do I get a 403 Forbidden error when accessing my new directory?

A 403 Forbidden error typically means your web server is blocking access to the directory. Common causes include incorrect permissions (for example, too restrictive), security rules from your host, or an .htaccess rule that denies access. Start by confirming the directory permissions are set to a typical value like 755, then check any .htaccess files in the folder and its parent directories. If the issue persists, contact your host’s support—some providers block certain paths for security reasons.

Is it safe to create directories in wp-admin or wp-includes?

Generally, no. The wp-admin and wp-includes directories are part of WordPress core, and adding custom folders there can cause conflicts during updates or introduce security risks. Always place your custom directories in wp-content/ (or within themes/plugins that are designed to handle them). That way, your changes are less likely to be overwritten and easier to manage over time.

Where is the best place to create custom directories in WordPress?

For most use cases, the best place is somewhere under wp-content/, because that’s where WordPress expects custom code, media, and plugin data. If the folder is tied to a specific theme or plugin, you might put it inside that theme’s or plugin’s directory. For general assets like downloads, a path such as wp-content/downloads/ keeps things tidy and separate from core files.

Do I need to hire a developer or buy tools to create directories?

In most cases, no. As long as you can log into your hosting control panel or use an FTP/SFTP client, you can create directories yourself by following the steps in this guide. A developer is helpful if you need complex automation, custom access rules, or integration with advanced plugins, but simply creating folders is a basic hosting task that doesn’t require paid tools.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button