Learn More About WordPress File and Directory Structure

WordPress File and Directory Structure

Do you want to know more about WordPress file and directory structure? The core WordPress plugins, themes, software and the users upload are all stored on your site. In this guide, we will briefly explain the WordPress file and directory structure.

Why You Should Know About WordPress file and directory structure?

Most of the users can run their WordPress website without even learning about the WordPress file and directory structure. Although, understanding how the WordPress stores files and directories that can help you to solve many common WordPress issues on your own. In this post, you will get more knowledge on the topics which is mentioned below:

  • Learn about which WordPress files and the folders are core files.

  • Know how WordPress stores your images and the media uploads.

  • Where the WordPress stores your plugins and themes.

  • Where the configuration files are stored on your WordPress install.

Reference Link: https://wordpress.org/support/topic/wordpress-directory-structure

This detailed information also helps you to learn about which WordPress files should you backup. You will also be able to perform the troubleshooting tasks like switching to a default theme, deactivating all WordPress plugins or fix other common WordPress errors. Having said that, lets have a look at WordPress file and directory structure.

How To Access WordPress Files and Directories?

First of all, you will need a FTP client to connect your WordPress server. An easier alternative to the FTP is File Manager. It is a web based application which comes built into the cPanel dashboard of your WordPress hosting account. Once you have connected to your WordPress domain either using File Manager or FTP, you will see a file and directory structure which looks like this:

 WordPress File and Directory Structure

Continue Reading: https://wordpress.org/support/topic/accessing-the-wordpress-directories

Files and Folders which is shown in the red squares are core WordPress files. These are the files and folders that run your WordPress website. You are not supposed to edit those files and folders on your own. Here is a list of core WordPress files and folders that you would see in your WordPress domain’s root directory:

  • [dir] wp-admin

  • [dir] 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

About WordPress Configuration Files

 WordPress File and Directory Structure

For More Info: https://codex.wordpress.org/Editing_wp-config.php

Your WordPress root directory contains few special configuration files. These files contains an important settings which is specific to WordPress domain.

  • .htaccess : It is a server configuration file and WordPress uses it to manage the redirects and permalinks.

  • wp-config.php : This file tells the WordPress that how to connect to your database. Also, it sets few global settings for your WordPress website.

  • index.php : The index file is basically loads and initializes all your WordPress files when a page is requested by the users.

Sometimes, you may need to edit .htaccess or wp-config.php file. Although, be extra careful while editing these two files because a slight mistake can make your website inaccessible. When editing these files, always create a backup copy on your PC before making any changes. Depending on how your WordPress domain is setup, you may or may not have the following files into your root directory.

  • robots.txt : It contains the instructions for search engine crawlers.

  • Favicon.ico : A favicon file is sometimes generated by the WordPress hosts.

Details on Inside wp-content Folder

 WordPress File and Directory Structure

 

WordPress stores all the themes, plugins and uploads in wp-content folder. Generally, it assumed that you can edit the files and the folders inside wp-content folder. Although, this is not completely true. Lets take a look on wp-content folder in order to understand how it works and what you can do here.

 WordPress File and Directory Structure

Read More: https://wpengine.com/support/downloading-wp-content-folder-previous-host

The contents of wp-content folder may differ from one WordPress website to another. But all the WordPress domains usually have these:

  • [dir] themes

  • [dir] plugins

  • [dir] uploads

  • index.php

WordPress stores your themes files in the /wp-content/themes/ folder. And you can edit a theme file, however it is usually not recommended. As soon as you update your WordPress theme to a newer version, then your changes will be overwritten during the update. That is why, it is strongly recommended to create a child theme for the WordPress theme customization. All the WordPress plug-ins that you download and install on your website are stored in the /wp-content/plugins/folder. So, you are not supposed to edit the plugin files directly, unless you wrote the plug-in just for your own WordPress domain.

In many other WordPress tutorials, you will see the code snippets which you can add to your WordPress website. The best way to add the custom code to your WordPress website is by adding it to the functions.php file of your child theme or by creating a website specific plugin. Whenever, you are creating a backup, you should include the upload folder. You can also download the fresh copies of WordPress core, installed plugins and your theme from their sources. But, if you lose you upload folder, it would be very hard to recover it without a backup. You may see some other default folders in your wp-content directory like languages and upgrade.

Many WordPress plug-ins may also create their own folders inside your wp-content folder. For instance, in the above screenshot we have a gallery folder which is created by the Envira Gallery plugin. Some of these folders may contain an important files, like gallery folder which contain your gallery images. You should always backup such folders in order to avoid losing important data. Other folders may contain files which you can safely delete. For example, your caching plug-ins like WP Super Cache or W3 Total Cache that may stored cached files in their own folders.

Resource Link: http://www.buildingwordpresswebsites.com/wordpress-file-directory-structure

That’s all, we hope this post helped you to understand the WordPress file and directory structure.

Leave a Reply

Your email address will not be published. Required fields are marked *