At some point, almost every WordPress webmaster will need to access their website’s files for different reasons: to fix something, add a piece of code to change a feature, backup, etc.
In this post, I’ll tell you how to access and edit your WordPress, themes and plugins files by using 3 different methods.
1. Access your files via WordPress “Editor”
The “Editor” is a WordPress built-in feature that allows you to access your themes and plugins files from inside your Dashboard. You can’t access your WordPress core files from here; check the second and third method for that.
Note: This feature might be disabled due to some security features/plugins you might use!
a) Accessing your theme files
- Log into WordPress, of course.
- Go to Appearance -> Editor.
- As you can see, on the right side, you have your current theme’s files, and on the left side, the area where the file’s code is displayed. There, you can add, remove or modify any piece of code you want. Don’t forget to press the “Update File” button.
b) Accessing your plugins files
- Log into WordPress.
- Go to Plugins -> Editor.
- There, you’ll see that things work like in the Theme Editor. Choose the plugin that you want to edit from the top-right corner, select the file from the right side, and then edit away.
2. Accessing your files via cPanel
cPanel is the most popular and most used control panel, and we’ve always worked with it, as many of you, I assume.
- First thing you need to do is to log into your cPanel, of course, which you can usually access by inserting your domain in your browser, followed by /cpanel (e.g. http://yourdomain.com/cpanel).
- Then search for your “File Manager”.
- Once you’ve accessed your File Manager, you’ll find yourself in the
public_htmlfolder, which contains the WordPress files, themes files and plugins files. Directly into the
public_htmlfolder, you’ll find the WordPress root files, but you usually won’t have any business with them, except if you want to increase your PHP memory limit, which usually fixes some common issues, like the the white screen of death error and HTTP error when uploading images.
- The files that you’ll access the most will be the themes and plugins files. You can find those by clicking the
wp-contentfolder, under the
- Now, if you want to edit a file from a theme, for example, just click on the themes folder, choose the theme you want, search for the file you need to edit, then right click on it and choose “Code Edit”.
- After that, the file will open and you can edit what you need. When finished, press the “Save” button found in the top-right corner.
3. Accessing your files via an FTP client
An FTP client is a software that allows you to edit and transfer files back-and-forth between your computer and your website’s server.
I’m using SmartFTP, so I’ll show you how to connect on that one. If you want to know how to connect and use FileZilla, check out their tutorial here.
So, in order to connect SmartFTP to your website’s server, you’ll need to go to “File” and select “Connection”. Once the connection pop-up appears:
- Insert the “Host”, which is ftp.yourdomain.com (replace yourdomain.com with your real domain/site name, of course).
- Insert the username and password for the FTP. These are usually provided by your web hosting provider after your purchase their services.
- Press OK and you should now connect to your website’s server, if everything goes right.
After the connection was created, you’ll notice that the layout is similar to cPanel. The editing process is also similar; just right-click on a file and select “Edit”.
Please note: Always download a backup of the file(s) that you want to edit! If you’re not familiar at all with this kind of stuff, I strongly recommend asking for guidance!
That’s a wrap
Hope you found the post comprehensive and useful! If so, don’t forget to share it with your friends!
If you have anything to say or ask, please drop a comment, or write us via our contact form or Facebook page.
If you want to receive our WordPress guides directly in your Inbox, then subscribe below.