In this article we are going to learn wordpress directory structure. The directory structure is the organization of files into a hierarchy of folders. It describes how files are arranged for an application. A hierarchy is similar to a tree structure. So let’s start WordPress directory and file structure.

The WordPress Directory Structure

  • The core WordPress files and directories are listed below.

wp-admin

wp-content

wp-includes

index.php

license.txt

readme.html

wp-activate.php

wp-blog-header.php

wp-comments-post.php

wp-config-sample.php

wp-cron.php

wp-links-opml.php

wp-load.php

wp-login.php

wp-mail.php

wp-settings.php

wp-signup.php

wp-trackback.php

xmlrpc.php

.htaccess

wp-config.php

These are the core WordPress directories and files. Now, let’s see some of the important files and folders in detail. Keep in mind that the first three are folders and rest are files.

wp-admin

  • The admin tools are powered by this folder. As it’s name indicates, this deals with the administrator. The main file inside this directory is the admin.php. It enables the connection to the database, displays the WordPress dashboard, and performs any other number of key functions, such as checking if any given user is in fact the admin in question.

wp-content

  • The next folder we are going to see is the wp-content. The Themes and Plugins are familiar to every WordPress user. These are stored inside this directory.

Plugin

  • The plugins are used to add more functionality to the WordPress site. Plugins can offer custom setup to the WordPress installation while the default WordPress installation is designed to be light weight.

Themes

  • The WordPress themes provide the graphical interface to the website. There are many files that work together to achieve this.
  • The themes and plugins are the major parts in the wp-content directory.

Upload

  • WordPress stores all your image and media uploads in the /wp-content/uploads/ folder. By default, uploads are organized in /year/month/ folders. Whenever you are creating a WordPress backup, you should include uploads folder.

wp-includes

  • The wp-includes is the final top-level folder and is large in size. As we have seen earlier, the wp-admin includes all the files necessary to power said admin functions, wp-content stores all your themes and plug-in, and wp-includes is what enables the site to run.
  • This folder is where most of the WordPress core files are stored. A fresh WordPress install will include over 140 different files in the main directory, and fourteen different folders including certificates, fonts, js, theme-compact, and widgets.
  • These subfolders aren’t important as the files included in the main folder, such as functions.php. This file is part of WordPress’ core, and it comes with a lot of the functions that enable the WordPress installation to work. As an example, some lines of code will be seen when you open the file on a text editor, and they’re just a regular function meant to transform dates into different formats.

index.php

  • The index file loads and initializes all your WordPress files when a page is requested by a user.

license.txt

  • This is WordPress license file. The WordPress is a free software and is licensed under the GNU General Public License as published by the Free Software Foundation.

readme.html

  • This core file contains the instructions to the user as its name indicates.

wp-activate.php

  • This contains the following:

do_activate_header()

  • Function: Adds an action hook specific to this page that fires on wp_head.

activate_wp_head

  • Fires before the Site Activation page is loaded, but on the wp_head action.

wpmu_activate_stylesheet()

  • Function: Loads styles specific to this page.

activate_header

  • Action Hook: Fires before the Site Activation page is loaded.

wp-config.php

  • It is one of the core WordPress files which contains information about the database, including the name, host (typically localhost), username, and password.

There are many other folders and files, but these are the most important folders and files in the WordPress directory structure.

WordPress directory and file structure are important to understand wordpress, So make sure learn it perfectly.

By admin

Leave a Reply