WordPress File Structure
The Core Folders of a WordPress Installation
A WordPress file structure is the set of folders and files that make up an installation. Most of it is the WordPress core, the code that runs the software. Three folders hold most of that code and content:
wp-adminholds the code for the dashboard, the back-end screens where content is managed.wp-includesholds shared core libraries used on both the public site and the back end, such as functions for database access and text formatting.wp-contentholds everything that differs from one site to another: themes, plugins, uploaded media and language files.
Where Your Own Files Live: wp-content and Configuration
The wp-content folder is the one site owners work with most. Themes and plugins sit in subfolders, and uploaded images and documents usually go into wp-content/uploads. Because this folder holds the site’s unique work, backups and migrations must always include it.
Two key files sit at the root, outside these folders. wp-config.php stores the database connection details, the authentication keys and other settings for the whole installation. .htaccess, on Apache servers, holds the rewrite rules that make clean permalinks work, as explained in the permalinks article.
Why You Should Not Edit Core Files
Customizations belong in themes, plugins and child themes, not in core files. Core updates replace the core folders, so any edit to a core file is lost at the next update. A damaged core file can also take the whole site offline.
For code that must run on every page, the usual options are a child theme or a must-use plugin, which WordPress loads automatically from its own folder.
Frequently asked questions
Is it safe to delete files in the WordPress folder?
Not without checking first. Core folders and wp-config.php are needed for WordPress to run, and deleting them can take a site offline. Unused themes and plugins can usually be removed through the admin area, which also deletes their files correctly.
Where does WordPress store uploaded media files?
Images, PDFs, videos and other media uploads are stored in wp-content/uploads, normally in subfolders organized by year and month. The database holds a record for each file, including its title and alt text, but not the file itself. A backup or migration must include both the files and the database.