WordPress Structure

Default WordPress File Structure

  • Installation Environment: WordPress can be installed on Windows, Linux, or Mac OSX. This module focuses on a default installation on an Ubuntu Linux server.

  • Requirements: A fully configured LAMP stack (Linux, Apache, MySQL, PHP) is necessary before installation. After installation, files are located in the webroot at /var/www/html.

Directory Structure

The following is the key directory structure of a default WordPress installation:

var/www/html
β”œβ”€β”€ index.php
β”œβ”€β”€ license.txt
β”œβ”€β”€ readme.html
β”œβ”€β”€ wp-activate.php
β”œβ”€β”€ wp-admin
β”œβ”€β”€ wp-blog-header.php
β”œβ”€β”€ wp-comments-post.php
β”œβ”€β”€ wp-config.php
β”œβ”€β”€ wp-config-sample.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

Key WordPress Files

  • index.php: The homepage of the WordPress site.

  • license.txt: Contains version information of the installed WordPress.

  • wp-activate.php: Used for email activation during site setup.

  • wp-admin: Contains the login page and backend dashboard for administrators. Login can be accessed via:

    • /wp-admin/login.php

    • /wp-admin/wp-login.php

    • /login.php

    • /wp-login.php

    • This file can be renamed for security.

  • xmlrpc.php: Facilitates data transmission using HTTP and XML, now largely replaced by the WordPress REST API.

WordPress Configuration File

  • wp-config.php: Essential for database connection, containing:

    • Database name, host, username, and password.

    • Authentication keys and salts.

    • Database table prefix.

    • Option to enable DEBUG mode for troubleshooting.

Example snippet:

Key WordPress Directories

  • wp-content: Main directory for plugins and themes. The uploads/ subdirectory stores uploaded files, which may contain sensitive data leading to vulnerabilities.

  • wp-includes: Contains core files excluding administrative components and themes, including certificates, fonts, JavaScript files, and widgets.

Last updated