Skip to content
  • Pricing
  • Products & Services
      Save 25%

      Solid Suite

      Secure your sites, keep them safely backed up, and grow your business… all while saving time and money.

      • Solid Security
      • Solid Backups
      • Solid Central
      • Solid Academy
      See pricing

      Protect

      Shield your site from cyberattacks and prevent security vulnerabilities

      A cloud-first solution for rocket fast backups and one-click restore.

      Repair

      Hacked website? Let our WordPress security experts clean up malicious code, remove threats and restore your site.

      Manage

      Maximize and amplify your admin with remote multi-site management.

      Ensure delivery of every email sent from your site.

      Free Plugins

  • Resources
      Save 25%

      Solid Suite

      Secure your sites, keep them safely backed up, and grow your business… all while saving time and money.

      • Solid Security
      • Solid Backups
      • Solid Central
      • Solid Academy
      See pricing

      Academy

      Solid Academy

      For anyone who wants to start or grow a business around WordPress.

      Guides

      Dive deeper into our free WordPress and business guides.

      Livestreams

      Free livestreams to help you discover new tools and work more efficiently

      Tutorials Academy

      Learn WordPress with our beginner WordPress tutorials

      Resources

      Blog

      Catch up on the latest news from our WordPress security experts

      Vulnerability Report

      Keep track of every new plugin and theme vulnerability

      Support

      Your success with Security, Backups and Central is our highest priority.

      Documentation

      Learn everything you need to know about our products & services.

Sign In Get Solid Suite
SolidWP Logo Black
  • Pricing
  • Products & Services
    • Solid Security Pro
    • Solid Backups — NextGen
    • Solid Fix
    • Solid Central
    • Free Plugins
    • Solid Security
    • Solid Performance
    • Solid Mail
  • Resources
    • Solid Academy
    • Guides
    • Livestreams
    • Tutorials
    • Blog
    • Vulnerability Report
    • Support
    • Documentation

Learn More

10
  • Clearing caches and transients in WordPress
  • Editing and handling the .htaccess file
  • Installing Downloaded Plugins in WordPress
  • Understanding PHP’s memory limit
  • Understanding PHP’s max_execution_time
  • Help! My Site’s Been Hacked!
  • How To Use WP DEBUG To Isolate Issues
  • Translation in WordPress
  • Editing and handling wp-config.php
  • Understanding Email Deliverability in WordPress
View Categories
  • Home
  • SolidWP Documentation
  • General WordPress
  • Learn More
  • Editing and handling wp-config.php

Editing and handling wp-config.php

3 min read

Why Modify wp-config.php #

The Power of WordPress is that it’s software you control installed on servers that you control. That power comes with responsibility: you as the site owner are often the one that needs to “open the hood” to make changes. 

One accepted way among plugin, theme, and agency developers in the WordPress space to make changes to WordPress is by directly modifying a key file: wp-config.php. This article will help you to confidently make changes to wp-config.php without having to worry about accidentally taking down your website. 

The SolidWP support team is here to make sure you’re confident in making changes to wp-config.php, so don’t hesitate to reach out.

What Is The wp-config.php File? #

The wp-config.php file is, as the name suggests, a configuration file that is part of all self-hosted WordPress sites.

Unlike other files, the wp-config.php file does not come built-in with WordPress. Instead, it’s generated specifically for your site during the installation process.

Among other things, WordPress stores your database information in the wp-config.php file. Without this information, your WordPress website will not work in any real way. 

Before You Edit #

Since wp-config.php is a critical file for your site to function, the first step before editing the wp-config.php file is to make sure you have a current backup of your WordPress site. 

Having a current backup of your WordPress website is critical for protecting your website. Solid Backups is here to help and can make the process easy and effortless. 

A good general principle in WordPress is to always have a way to restore to any file or database entry before making a change to it. 

Where Is The wp-config.php File? #

Technically speaking, the wp-config.php file can be found in what’s called the “root” directory. If you are unsure of where/what your root directory is, your host should be able to provide guidance. Briefly, it’s the same directory where you’ll see these directories:

  • wp-content/: Where your themes, plugins, and uploads (like images) are stored.
  • wp-admin/: The files that power the WordPress dashboard.
  • wp-includes/: Core files that WordPress needs to function. 

In order to download and edit the wp-config.php, you will need to use a text editor, like Sublime Text, Notepad, Text Editor (mac), etc. It’s critical to NOT use Microsoft Word or Google Docs or any other word processor, as those can reformat code (in an attempt to be helpful) and cause the saved file to not function. 

How To Use FTP To Find wp-config.php #

If you don’t have access to cPanel you can use an FTP client to do it instead. A good choice here is FileZilla.

  1.  Find your FTP credentials. If you are unsure where to find the credentials or do not have access to them, you can contact your web host and request your credentials.
  2. Launch Filezilla, enter your FTP credentials at the top– the hostname, username, and password – and click on Connect.
  3. Once a connection is successfully established, you should see the folder ‘public_html’. Select that folder, and there you will find the wp-config.php file. 
  4. Right-click the wp-config.php file and select download to download the file to a file editor. 

How Do I Access WP-Config.php Without FTP? #

If you do not have access to or would prefer not to use FTP to edit the wp-config.php file you can use the cPanel. The cPanel is your website’s control panel that you can access through your web hosting dashboard.

  1. Log into your hosting account.
  2. Go to cPanel.
  3. Choose File Manager. You will see many files and folders on this page. 
  4. Select the public_html folder, then the wp-config.php file. 

Things to know about editing the wp-config file #

In the default wp-config.php file, comments are there to help explain what the code does and are ignored by WordPress. You can spot them because they either start with // or are wrapped between /* and */. For example:

Single-line comment:

// Change this to the name of your database.

Multi-line comment:

/*

 * This is a multi-line comment.

 * It spans multiple lines and is used for longer explanations.

 */

You’ll see comments like these near settings, such as:

// ** MySQL settings - You can get this info from your web host ** //

Comments are safe to read or ignore, but don’t delete them unless you know it won’t cause confusion later. Always focus on the code lines that look like define('DB_NAME', 'your_database_name'); when making changes. 

Always start your edits as a new line, and pay close attention to quotation marks ' and " as well as semicolons ; as it is surprisingly easy to join the ranks of developers who have taken down their site with an errant punctuation mark.

It’s worth mentioning again: don’t edit the file in a way that you can’t recover from (with a site backup), and you should be all set!

Updated on December 6, 2024

Was this doc helpful?

  • Happy
  • Normal
  • Sad
Translation in WordPressUnderstanding Email Deliverability in WordPress
Table of Contents
  • Why Modify wp-config.php
  • What Is The wp-config.php File?
  • Before You Edit
  • Where Is The wp-config.php File?
  • How To Use FTP To Find wp-config.php
  • How Do I Access WP-Config.php Without FTP?
  • Things to know about editing the wp-config file
SolidWP
  • Pricing
  • Products
    • Solid Suite – save 25%
    • Solid Security
    • Solid Backups — NextGen
    • Solid Central Pro
  • Resources
    • Blog
    • Academy
    • Guides
    • Tutorials
    • Vulnerability report
  • Support
    • Documentation
  • My account
  • Contact us
    • Terms
    • Refund policy
    • Privacy policy
  • About SolidWP
    • FAQ
    • Looking for iThemes?
    • Affiliates
    • Press
  • Our Partner Brands
    • GiveWP
    • Iconic
    • KadenceWP
    • LearnDash
    • MemberDash
    • Orderable
    • The Events Calendar

Get Solid Suite bundled with hosting.

Explore StellarSites
  • X
  • YouTube
  • Facebook

A Liquid Web Brand
Hosting for WordPress
© 2025 All Rights Reserved

StellarWP logo
Liquid Web logo