Where is the functions.php file in WordPress?
Wordpress

Where is the functions.php file in WordPress?

The functions.php file in WordPress is located in your themes folder. I will show you three ways to access this file.

If you are planning to add code to this file, make sure you have a backup or copy of the file before you add the code. This file is important, it makes sure your site theme runs. If you add code that WordPress can’t read, your site will crash.

Let’s find your functions.php file.

One – WordPress admin dashboard

In your WordPress admin dashboard, hover your mouse over ‘Appearance’, and select ‘Theme editor’ from the popup menu.

Like this.

Select theme editor from the menu

Once you select ‘Theme editor’, WordPress warns you that editing files directly from your WordPress dashboard could cause your site to break. WordPress recommends that you edit files in your Cpanel. That way you can make a copy of the file, should anything go wrong, then you replace the edited file with the original.

WordPress warning

If you are sure you want to edit your functions.php file from your dashboard, select the blue ‘I understand’ link.

Now you have access to all the files for your website. The files are listed on the right. The functions.php theme is under ‘Theme functions’.

Website file list in WordPress

To edit your functions.php file, select the blue ‘Theme functions’ link.

Now you can edit the file.

Functionc.php file in your WordPress dashboard

You add your code within the window. Once you have finished adding your code, don’t forget to click on the blue ‘Update file’ link at the bottom of the page.

Two – File manager in Cpanel

In the dashboard of your Cpanel, look for the ‘File Manager’ icon. This is my dashboard and the icon is at the top.

File manager in Cpanel

Once you are in the ‘File Manager’ look for your ‘public_html’ folder and open that folder.

public_html folder

In the ‘public_html’ folder, you will find all your website’s files and folders. From this list, we want to find and open the ‘wp-content’ folder.

wp-content folder

In your ‘wp-content’ folder, locate and open the ‘themes’ folder.

themes folder

Next, you have a list of themes installed. Open the folder of your active theme. My active theme is Ashe.

Active theme folder

If you are not sure of the name of your active theme. Go to ‘themes’ in your WordPress dashboard, your active theme is on the top left.

Active theme

Your functions.php file is in your active theme folder.

Functions.php file

Before you edit this file, I recommend you download a copy first. Then if you have an issue with your site after editing this file, you can replace it with the downloaded file.

To download or edit this file, right-click on your mouse.

Right-click to download or edit your functions.php file

Three – Filezilla FTP client

Another way to gain access to your functions.php file is by using an FTP client. A very popular FTP client is Filezilla and that is what I will be using for this tutorial.

Filezilla allows you to gain access to your website files without going through your Cpanel dashboard.

After you log in to your website through Filezilla, your site files are in the two windows on the right. Your computer files are in the two windows on the left.

On the right, look for the ‘public_html’ folder.

public_html folder

As we had with the ‘File Manager’ in Cpanel, we have access to our website folders and files.

Now, we are looking for ‘wp-content’.

wp-content folder

Open the ‘wp-content’ folder and look for the ‘themes’ folder.

Themes folder

In the themes folder, look for your active theme. My active theme is ‘Ashe’. If you are not sure of the name of your active theme, select ‘Themes’ from the menu on the left in your WordPress editor. Your active theme is the first theme on the top left.

Active theme
Active theme folder

You will find the ‘functions.php file in your active theme folder.

Functions.php file

Before you edit this file, I recommend you download a copy to your computer. If your website has errors after you edit the functions.php file, then you can upload the original copy to overwrite the edited file.

To download and edit this file, right-click with your mouse.

Right-click to download and edit your functions.php file

If you would like to use Filezilla, check out my ‘How to download and install Filezilla‘ post.

Conclusion

There are three ways to gain access to your functions.php file in WordPress.

Access the file through your WordPress admin dashboard is the quickest method but comes with risks. If your code is wrong, you could break your site.

The safest options are through your Cpanel and an FTP client. You can download a copy to your computer before you edit the file. Should you break your site, then you can replace the edited file with the original and your issues are solved.

If you prefer video tutorials, check out my YouTube channel, I have videos about WordPress, SEO, keyword research, and the Amazon Affiliate program.

Comments

If you have any questions about this post or WordPress, please leave your questions in the comments box below. I check for comments every day.

I look forward to reading your comments.

Sharing is caring!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.