How To Find And Edit The Functions.php File In WordPress


In my post, I show you how to access and edit functions.PHP on your WordPress website, step by step.

Functions.php is in your theme folder. There are three ways to access functions.php, WordPress admin, a hosting Control Panel, or an FTP client.

Let’s begin.

How To Access And Edit The Functions.PHP File Through WordPress Admin

Before making edits to functions.php, run a backup of your website. For a WordPress tutorial on backing up your site, check out my ‘How to back up your WordPress website‘ post.

  1. Select Appearance and then Theme Editor from the menu.
  2. From the list of files, choose Functions.PHP.
  3. Add your code.
  4. Select Update File.

Hover your mouse over Appearance and select Theme Editor from the menu.

Select theme editor from the menu

Select Theme Functions (functions.php) from the list.

Functions PHP file

Add your code, then click on Update File.

Update file to actions edits

Once updated, you receive a confirmation message.

Update file confirmation message

After saving your updates, go to your website to ensure everything is working.

How To Access And Edit The Functions.PHP File Through Your Hosting Control Panel

  1. Select File Manager from your Cpanel dashboard.
  2. Open the public_html folder.
  3. Open the wp-content folder.
  4. Open the themes folder.
  5. Open the folder to your active theme.
  6. Right-click functions.php to make a copy.
  7. Right-click functions.php to edit.
  8. Confirm edits.
  9. Add code.
  10. Select Save Changes.

On your Cpanel dashboard, select the File Manager icon.

Select file manager

Next, choose public_html from the list on the left or center.

Open public_html

Open the wp-content folder.

Open wp-content

Open the themes folder.

Open themes

Next, select your active theme folder. For example, my active theme is Kadence.

Open your current active theme folder

The functions PHP file is in your active theme’s folder. I recommend you make a copy before you edit it.

Functions PHP file

To make a copy, right-click and select Download. Should your site have problems, you can upload the original.

Right click to download or edit

To add code, right-click and select Edit.

Right click to download or edit

A warning asks you to make a copy before editing. To continue, select Edit.

Select edit to continue

Make your edits and then select Save changes.

Save changes

After updating your changes, go to your website to ensure everything is working.

How To Access And Edit The Functions.PHP File Through An FTP Client

  1. Connect to your website
  2. Open the ‘public_html’ file.
  3. Open the ‘wp-content’ file.
  4. Open ‘themes’.
  5. Open your active theme file.
  6. Right-click to make a copy.
  7. Right-click to edit.
  8. Add your code.
  9. Select ‘File’ and then ‘Save’ to update your changes.
  10. Confirm changes.

For this tutorial, I am using the Filezilla FTP client. Check out my ‘How to install Filezilla guide‘ post to learn how to download and install Filezilla.

After you connect to your website via Filezilla, your website files are on the right, and your computer files are on the left.

On the right, open the public_html folder.

Open puiblic_html

Next, open the wp-content folder.

Open wp-content

Then open the themes folder.

Open themes

In the themes folder, select your active theme.

Open your current theme folder

Before making changes to functions.php, I recommend you make a copy. If your site has issues after updating, upload the original.

Functions PHP file

To make a copy, right-click and select Download.

Right-click to edit and download

To add code, right-click and select View/Edit.

Right-click to edit and download

Add your code. Then click on File and select Save.

Save your changes

Confirm your changes by selecting Yes.

Confirm changes

Once updated, you receive a confirmation message.

Update confirmation

Finally, visit your website to check that everything is working.

Conclusion

Functions.php is in your theme folder. You can access it through your WordPress admin, hosting Cpanel, or an FTP client.

Before you make any changes to functions.php, ensure you are confident the code you plan to add is correct. Functions.php is essential for your site. Code errors will break your site.

I recommend accessing functions.php through your Cpanel or an FTP client. You can download a copy to your computer before you edit. Should you break your site, replace the edited one with the original.

For more WordPress tutorials, check out my YouTube channel. I have videos about WordPress, SEO, keyword research, and the Amazon Affiliate program.



More posts…



Leave a Reply

Your email address will not be published.

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