WordPress Files and Folder Structure

When you open the WordPress folder, you see many files and three main folders. Knowing them helps you to find things, fix problems and keep your site safe.

The root folder

Terminal output

$ ls -a
.
..
.htaccess
index.php
license.txt
readme.html
wp-activate.php
wp-admin
wp-blog-header.php
wp-comments-post.php
wp-config-sample.php
wp-config.php
wp-content
wp-cron.php
wp-includes
wp-links-opml.php
wp-load.php
wp-login.php
wp-mail.php
wp-settings.php
wp-signup.php
wp-trackback.php
xmlrpc.php

What each part does

ItemWhat it is
wp-admin/The code of the dashboard. Never edit it
wp-includes/The core libraries and functions. Never edit it
wp-content/Your own content: themes, plugins and uploads. This is your working folder
wp-config.phpMain settings: database connection, security keys and debug mode
wp-load.php, wp-settings.phpStart the WordPress environment on every request
wp-login.phpThe login page
wp-cron.phpRuns the scheduled tasks
xmlrpc.phpAn old remote access file. Most sites do not need it, so many people disable it
index.phpThe entry point. Every page request goes through it
.htaccessServer rules for pretty permalinks (Apache)
readme.html, license.txtInformation files. You can delete readme.html to hide the version

Inside wp-content

Terminal output

$ ls wp-content
index.php
plugins
themes
uploads
$ ls wp-content/plugins
akismet
hello.php
index.php

  • themes/: all installed themes.
  • plugins/: all installed plugins.
  • uploads/: media files you upload.
  • mu-plugins/: “must use” plugins. They load automatically and cannot be turned off from the dashboard. Create it yourself if needed.
  • languages/: translation files.
  • upgrade/, cache/: temporary files, created when needed.

Which files are safe to edit?

Folder or fileEdit?
wp-admin, wp-includesNo. Updates will overwrite your changes
wp-config.phpYes, with care, and take a backup first
Active themeOnly in a child theme, or your own theme
Plugins from othersNo. Use settings or hooks instead
wp-content/uploadsOnly to upload or clean files
Note: The core folders are replaced on every WordPress update. Always keep your own code in a theme, a child theme or your own plugin. Next: The wp-config.php File.

Congratulations! Chapter Finished. Learn more about the similar topics:
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.