Whats inside WordPress: A look into its folder structure
WordPress is renowned throughout the world for being highly user friendly and easy to learn. It has a feature rich dashboard from where you can configure and control most of the aspects of your WordPress website. The backend of the WordPress software is just as organized and user friendly. The only problem is that it requires good knowledge of WordPress and its architecture to properly manipulate it from the backend. But if you are serious about WordPress programming or like to experiment in your WordPress site, it’s important to know what goes where. Because no matter how careful you remain you are bound to break your WordPress site once or twice and the best way to rectify it would be from the back-end.
Image Credit @ Mikhail Nishchenko
Experiment all you want but in localhost
It’s alright to experiment with your WordPress website. But it’s best to experiment on a localhost virtual server installation of your website so you don’t decrease the uptime of your live site. Also localhost installation can be taken down without any problem and once you are satisfied with the results, it can be easily updated on the live domain. Also it’s better to take a backup of your WordPress folder and database on a safe and secure location before any new change.
WordPress folder and its structure
To understand WordPress you have to first download the WordPress software. It’s a zip file so extract it in the right folder according to your needs, for example, if you want to install it on XAMPP local host extract it in xammp/htdoc/ folder, or if you just wish to check the contents extract anywhere you like.
WordPress or WordPress 3.5.1 to be more exact, contains three additional folders inside the main WordPress folder, along with some PHP files. These folders are named wp-include, wp-admin, and wp-content. All three folders are equally important and are helpful in their own way. Here we discuss in brief about what each folder contains and what they are used for.
Wp-content as the name suggest is where your content goes. The main folders inside wp-content are Theme, Plugins, and Uploads, and they also contain exactly what they are named, i.e., Theme contains all the themes you have created or downloaded for use in your WordPress site. All the themes are also neatly arranged in folders whose names match exactly with the theme name. For example all the content of the twenty twelve theme would be placed in folder named Twentytwelve . So the correct path of the theme becomes WordPress/wp-content/twnetytwelve/. Same is the case with plugins. So, if you install a plugin that completely breaks your WordPress dashboard or install a theme that is not allowing you to open the dashboard, just go to wp-content/theme or wp-content/plugin folder and delete the folder that is named according to the malfunctioning theme or plugin. In 95% of the cases this fixes the problem. If it still doesn’t solve the issue, use the backup (so you see backups are important).
Uploads folder contains all the images and videos that you have uploaded on your WordPress site. They are arranged in folders named according to the year and then into subfolders according to the month’s number. So, if you wish to migrate your whole image gallery from one site to another, or wish to take a backup of your images, this is the folder to work with.
AuthName “Access Control”
deny from all
# whitelist first IP address
allow from 192.168.1.1
# whitelist second IP address
allow from 192.168.1.2
allow from 192.168.1.3
WordPress is a very versatile tool but to understand the true magic of WordPress it is necessary to understand how it works and what goes where. Knowledge about WordPress folder structure is also important in creating custom themes and custom plugins for your WordPress site.