Editor’s note: The following article is curated from the GoDaddy community. We’ve made some light edits for formatting and clarity. Looking for help with GoDaddy products or getting your business online? Join the community to get answers from other GoDaddy customers.
Where do you change WordPress files?
Some folks jump over to Appearance > Editor and start modifying the .php files within their theme. They then end up with a broken site.
That is why many hosts have the theme editor turned off by default. If you don’t understand the layout and syntax of PHP, you risk easily breaking your site.
That said, there will be times that you do want to tweak certain files in your theme.
Here’s an overview of WordPress’ file structure so you can get familiar with what is where. Including the files that are commonly modified (with great care).
WordPress file locations
If you’re using cPanel web hosting you can use the File Manager interface in your cPanel to view your files. Otherwise you can also use an FTP client like FileZilla to connect to your hosting server and view files that way.
Your website root
To locate your website files navigate to the root of your hosting account. This is generally labeled as “public_html”.
If WordPress is installed in the root folder this is where you’ll find the WordPress core 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:
The .htaccess file is a configuration file used by Apache, the most common web server software.
One of the most important files in your WordPress installation is the wp-config.php file. This file is located in the root and contains your website’s base configuration details, such as database connection information.
The /wp-admin/ directory
The /wp-admin/ directory is where all the backend WordPress dashboard files are located. There’s no reason for you to change any files there.
The /wp-content/ directory
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 /wp-content/themes/ directory
The themes directory is where you will find your theme files— and your style.css file. The style.css file is the file most size owners will want to modify. The style.css file contains the global font sizes, colors, layouts and spacing for your theme.
The /wp-content/plugins/ directory
The plugins directory contains plugin files.
The /wp-content/uploads/ directory
The uploads directory contains graphics and files you have uploaded for your pages and posts. Your site’s media is organized by year/month.
The /wp-includes/ directory
Rarely will there be a reason to change any files in the wp-includes directory. This directory includes the packages that are included by the WordPress core that are maintained by the WordPress core team. Your themes and plugins rely on those packages being available.
You can view an entire list of the WordPress directory structure and the files in the WordPress codex.
A word of warning…
Before modifying any files, you should always make a copy of the original and save it to 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.
New to WordPress? WordPress Hosting from GoDaddy includes free WordPress training videos. Find out more about GoDaddy’s WordPress Hosting plans.
Already a WordPress Hosting customer? Sign in to work on your site.
Also published on Medium.