Join Morten Rand-Hendriksen for an in-depth discussion in this video Managing WordPress on the back end, part of WordPress Essential Training.
- After spending all this time working with WordPress in the browser, it's time to take a look behind the curtain at what WordPress, the application, looks like and what we've actually been doing. When you installed WordPress at the beginning of our journey, you likely used an FTP client to place the application on the server of your web hosting provider. Now we can use an FTP client to go in and take a look at WordPress itself. Here you see my WordPress installation, live on the server I've been working on this entire time. But instead of using a regular browser, I'm using an FTP application to gain access to WordPress.
And what I'm seeing are all the files that make up the application itself. As you can see, WordPress consists of a series of php files, like index.php, and wp-config.php, and pretty much all of these files are prefixed with wp. These are the core files of WordPress, and in addition you also have three core folders. wp-admin, wp-content, and wp-includes. Now of all content inside this folder here, the only two pieces of content that are not replaceable, is wp-content and wp-config.
The wp-content folder contains all the customization options that you've been adding to your WordPress site as we've been moving along. Here we can see we have a languages folder, which contains the language files if you chose to change the language of WordPress from English to something else. We have a plugins folder, that contains all the plugins we installed in WordPress. We have a themes folder, that contains all the themes installed. We have an upgrade folder, which contains the upgrade files. And finally, you have the uploads folder, which contains all the images and other files you've uploaded, sorted by first year, then month, and here we can see all the files.
And here for the first time, you get to see how WordPress is handling image files. You remember from earlier in the course, I mentioned, of when you upload image files to WordPress, WordPress will take the image file, and then create new versions of that file. Well, here you can see that in action. If we look at this cropped header for instance, here is the original file I uploaded called cropped header.jpg, and then WordPress has created a series of additional files for me. Here we have the thumbnail, which is 150 by 150. We have the medium size, which is 220 by 300.
We have the large size, which is 751 by 1024. And then we also have a cropped header size, which is 825 by 510. Now these are all files WordPress has created on my behalf, and they're all stored in this uploads folder. So when you add an image to a page, and you say, I want image to be the thumbnail. WordPress will go and grab this thumbnail file rather than the original, and thereby you are saving a lot of data when you downloaded onto your browser. You'll also remember that in the plugins chapter, I talked about a plugin called Regenerate Thumbnails? Well, what happens when you used the Regenerate Thumbnails plugin, when you've switched to a new theme is, WordPress will go through these images here, and check to make sure it actually has the right sizes.
If it doesn't, it'll go back to the original image and regenerate a new image that is then added to this list. The other important file here, is the one called wp-config. This is the file that contains the configuration options for WordPress, that lets WordPress talk to the database. To see how this works, I'm going to open that file on my computer in a text editor. Here you see we have wp-config. It starts with a large comment explaining what it does, and then we have the configuration section, where you set up the database name, the database username, the database password, and also the hostname.
So, the location where the database is hosted. These are all the fields that are filled out when you go through the WordPress install process in your browser, but in some rare cases you may have to do it manually, and in that case, you would do that in the file called wp-config.php. This is also the file you want to save anytime you want to wipe out WordPress completely and then reinstall a new version because of these settings. But, if you somehow lose the data here, so your database name, or username or password, you can always get it again from your hosting provider.
There are couple of other important things in wp-config. If we keep scrolling down, you have what's known as Unique Keys and Salts. These are randomly generated keys that allow Wordpress to test whether you are in fact who you say you are, when you make settings changes and create new content. You don't have to worry about this. The only thing you need to worry about is, if you go into a WordPress installation, and you see that the salts and keys are empty. This is also what you would want to change anytime you think your site has been attacked. But like I said, that's extremely rare, and if it happens, you probably want to talk to a professional about getting your site cleaned up.
Scrolling down, we have the table prefix. This is the database table prefix that you set up when you set up original WordPress site. In most cases, it'll just be wp_, but if you want to change it, you can change it here. Just remember, if you change the table prefix, after setting up your site, then WordPress will no longer find its tables. So it's important that this table prefix matches the actual table prefix in your database. So, once you've set up your site, don't touch it. But if you're setting up a new site, you can define a new table prefix here if you want to.
Or you can do in the web interface. Finally, WordPress comes with a debugging function that will tell you if there's something wrong with the code on your site. Now this is an advanced feature, that is usually only used when you are developing new themes on your plugins. But in some cases, if you're having trouble with WordPress, you may be able to find out what that trouble is by changing the WP_DEBUG setting, from false to true. In this case, WordPress will display error messages in the browser, so if people visit your site and there's an error, you'll actually see the error message displayed.
So this is risky behavior, but if something is disastrously wrong with your site, this might be the first place to go to just find out exactly what is happening. Now you have a better idea of what WordPress looks like on the back end, and in the next chapter, we'll talk about troubleshooting WordPress when things don't work as they're suppose to. And that often involves going into the backend, and making changes to the files you're seeing right here.
Note: This course covers WordPress 4.3. We will update the training as WordPress evolves.
- Creating posts and pages
- Formatting text
- Publishing and scheduling posts
- Adding images, audio, and video
- Bulk editing posts and pages
- Customizing themes and menus
- Using widgets
- Extending WordPress with plugins
- Editing users profiles
- Configuring settings
- Getting new readers
- Keeping WordPress up to date and secure