Back in the day websites started out as “web sites” and they were coded in basic HTML.
Then there was WordPress.
What my clients like most about WordPress is they can find a premium theme and tweak their site to look the way they want without having to be a professional coder. Knowing a handful of basic HTML snippets can help you format your posts and widgets but you need not know the underlying .php that is WordPress.
Where do I change WordPress files?
When I’m asked that question, I respond with “which files and why”? In most cases, as a website owner rarely, if ever, should you have to modify the WordPress core files.
Some folks jump over to Appearance > Editor and start modifying the .php files within. They then end up with a broken site. That is why many hosts have that area “turned off” by default. If you don’t understand the layout and syntax of .php, stay out of the file editor area.
There will be times that you do want to tweak certain files. Here’s an overview of WordPress’ file structure including the files that are commonly modified (with great care).
WordPress File Locations
Depending on your hosting setup, you may have a File Manager interface in your cPanel where you can get at your files. Or you have the option of “FTPing” into your server.
I use and recommend Filezilla, a free FTP (File Transfer Protocal) software program. You input your FTP settings provided by your host and you’ll be able to view your server’s directory tree. They’ll be similar to the images in this post.
All your website files are located in the root of your server which is generally labeled “public_html” or just “html”.
In the root are all the core WordPress files. The only files you may need to modify in the root, if you are confident that you know what you are doing, would be:
robots.txt: Website owners use the /robots.txt file to give instructions about their site to web robots; this is called The Robots Exclusion Protocol. The “User-agent: *” means this section applies to all robots. The “Disallow: /” tells the robot that it should not visit any pages on the site.
.htaccess: These .htaccess files can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer.
wp-config.php: One of the most important files in your WordPress installation is the wp-config.php file. This file is located in the root of your WordPress file directory and contains your website’s base configuration details, such as database connection information.
The wp-admin directory is where all the backend WordPress Dashboard files are located — no reason for you to change any files there.
This is where you’ll find your plugin, theme files and uploads. While there are other directories there as well, you most likely will never have to go into those.
The Themes directory is where your theme files are located — and your style.css file. The style.css file is the file most size owners will want to modify as this file contains the global font sizes, colors and spacing for your theme.
- If you have a child theme that is the style.css file you want to modify and it is located in your child theme’s folder (Agency Pro in the example graphic). You do not want to change your framework’s .css (Genesis in the example graphic.) as those changes will be overwritten with any future updates.
- If you don’t have a child theme, why not? Without a child theme it will be critical that you keep revision copies of every change you make to any file including the style.css because when your theme updates, all those tweaks will be wiped out and have to be reapplied. By using a child theme you will ensure that your modifications are preserved. Find out more.
The plugins directory will have all your plugin files.
The uploads directory will have all the graphics and files you have uploaded for your pages and posts. These are organized by year/month.
Unless you are a skilled developer, there will never be a reason to change any files in the wp-includes directory. This directory includes the packages that are included by core that are maintained by the WordPress core team. Your themes and plugins can rely on those packages being available for any given version of WordPress.
You can view an entire list of the WordPress directory structure and the files within here.
Before Modifying Any File…
When modifying any files, you should always make a copy of the original and save it on your hard drive. This way, if you do not like the results you can easily restore the entire original code and go back to the drawing board.
At your service,