The WordPress Folder Structure

WordPress is one of the most popular content management systems (CMS) in the world. Part of what makes it so flexible and powerful is its well-organized folder structure. Whether you are a developer customizing themes or plugins, or an admin managing a WordPress site, understanding the core folder structure helps you navigate, troubleshoot, and extend WordPress effectively.


Overview of WordPress Folder Structure

After you install WordPress, the root directory contains several core files and folders. The main folders you’ll typically see in the WordPress installation root are:

  • wp-admin/
  • wp-content/
  • wp-includes/

Along with these folders, you will find core PHP files like index.php, wp-config.php, wp-login.php, and others.


Main Directories Explained

1. wp-admin/

  • This folder contains all the files related to the WordPress dashboard and administration area.
  • It includes PHP scripts, stylesheets, and JavaScript files necessary for the admin interface.
  • This is where all admin page logic resides.
  • Example files/folders: admin.php, css/, js/, includes/

Note: Avoid modifying files here directly because WordPress updates will overwrite changes.


2. wp-content/

  • This is the most important folder for customization and user content.
  • It contains user-uploaded content, themes, plugins, and other custom files.
  • You can safely modify or add files here without affecting WordPress core files.

Key subfolders inside wp-content/:

  • themes/ — contains all installed themes.
  • plugins/ — contains all installed plugins.
  • uploads/ — stores all media files you upload (images, videos, documents).
  • languages/ — contains language files for localization.

Developers mainly work inside wp-content to build and deploy custom themes and plugins.


3. wp-includes/

  • This folder contains the core WordPress code and libraries.
  • It includes PHP files responsible for essential WordPress functionality like formatting, HTTP requests, widget management, and more.
  • Example files: functions.php, pluggable.php, general-template.php

Warning: Like wp-admin/, avoid editing anything inside wp-includes/ directly, as updates will overwrite your changes.


Important Files in the Root Directory

Besides the three main folders, the WordPress root directory includes several important files:

  • wp-config.php — configuration file for database connection and site settings.
  • index.php — loads and initializes WordPress.
  • .htaccess — Apache server configuration file (used for URL rewriting, security).
  • wp-login.php — handles the login page.
  • xmlrpc.php — provides remote procedure call protocol support.
  • license.txt and readme.html — information files about WordPress.

Why Is Understanding the Folder Structure Important?

  • Customization: Knowing where themes and plugins live helps you customize your site without breaking core files.
  • Security: Understanding which folders are safe to edit reduces risk of damaging the site.
  • Troubleshooting: When debugging errors, you can locate the source faster.
  • Backups: Knowing which folders hold user data helps in creating proper backups.
  • Updates: Core files are updated automatically; avoid editing them directly to prevent losing your work.
Folder/File Purpose Editable by User?
wp-admin/ WordPress admin dashboard files No
wp-content/ Themes, plugins, uploads, and custom files Yes
wp-includes/ Core WordPress code and libraries No
wp-config.php Site configuration settings Yes (carefully)
.htaccess Web server rewrite rules and security Yes (if needed)
index.php Main entry file to load WordPress No

Frequently Asked Questions (FAQs)

Can I modify files inside the wp-admin or wp-includes folders?
Modifying files inside the wp-admin or wp-includes directories is strongly discouraged because these folders contain core WordPress files that are updated regularly. Any changes made directly here will be lost when WordPress updates, which can break your site or cause unexpected behavior. Instead, it’s best practice to customize your site through plugins or themes located in the wp-content folder, ensuring that your modifications persist safely.

Where should I add my custom themes and plugins?
Custom themes and plugins should always be added to the wp-content/themes/ and wp-content/plugins/ directories, respectively. These folders are designed to hold user-generated content and code, so WordPress does not overwrite them during updates. By organizing your customizations here, you ensure they remain intact and easy to manage while maintaining the integrity of the WordPress core files.

What is the purpose of the wp-config.php file?
The wp-config.php file stores your database connection details, authentication keys, and other important configuration settings. This file acts as the bridge between WordPress and your database, allowing the CMS to retrieve and store information. Because of its importance, it should be handled carefully and kept secure from unauthorized access.

How can I safely back up my WordPress site?
To back up a WordPress site effectively, you should focus primarily on the wp-content folder and your WordPress database. The wp-content folder contains all your uploaded media, themes, and plugins—basically all the customized parts of your site—while the database stores your posts, pages, comments, and settings. Since the core WordPress files in wp-admin and wp-includes can be restored from the official WordPress source, backing up your content and database is sufficient to restore your site in most cases.

What is the role of .htaccess in WordPress?
The .htaccess file, found in the root WordPress directory, is a powerful server configuration file primarily used for URL rewriting, which enables the clean, “pretty” permalinks that improve site readability and SEO. Additionally, it can be customized to implement security rules, redirects, and caching directives. Properly configuring .htaccess enhances your website’s performance and security, but caution is needed when editing it since incorrect rules can make your site inaccessible.

Understanding the WordPress folder structure is essential for anyone working with WordPress, whether you’re a beginner, site administrator, or developer. The clear separation between core files (wp-admin and wp-includes) and user-generated content (wp-content) helps maintain site stability and security. By focusing your customizations within the wp-content folder, especially inside themes and plugins, you ensure your work remains safe during updates. Additionally, knowing where key configuration files live allows for effective troubleshooting, security hardening, and smooth site management. Master this structure to take full control of your WordPress site and streamline your development workflow.