Edit your wp config php

How to Edit wp-config.php File in WordPress

Last updated on August 26th, 2015 by Editorial Staff | Reader Disclosure Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

Did you read a tutorial that asks you to edit your wp-config file, and you have no idea what it is? Well we’ve got you covered. In this article, we will show you how to properly edit the wp-config.php file in WordPress.

What is wp-config.php File?

As the name suggests, it is a configuration file that is part of all self-hosted WordPress sites.

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

WordPress creating wp-config.php file during the installation

WordPress stores your database information in the wp-config.php file. Without this information your WordPress website will not work, and you will get the ‘error establishing database connection‘ error.

Apart from database information, wp-config.php file also contains several other high-level settings. We will explain them later in this article.

Since this file contains a lot of sensitive information, it is recommended that you don’t mess with this file unless you have absolutely no other choice.

But since you’re reading this article, it means that you have to edit wp-config.php file. Below are the steps to do it without messing things up.

Video Tutorial

If you don’t like the video or need more instructions, then continue reading.

Читайте также:  Название документа

Getting Started

First thing you need to do is to create a complete WordPress backup. The wp-config.php file is so crucial to a WordPress site that a tiny mistake will make your site inaccessible.

You will need an FTP client to connect to your website. Windows users can install WinSCP or SmartFTP and Mac users can try Transmit or CyberDuck. An FTP client allows you to transfer files between a server and your computer.

Connect to your website using the FTP client. You will need FTP login information which you can get from your web host. If you don’t know your FTP login information, then you can ask your web host for support.

The wp-config.php file is usually located in the root folder of your website with other folders like /wp-content/.

wp-config file is located in the root directory of your WordPress site

Simply right click on the file and then select download from the menu. Your FTP client will now download wp-config.php file to your computer. You can open and edit it using a plain text editor program like Notepad or Text Edit.

Understanding wp-config.php file

Before you start, let’s take a look at the full code of the default wp-config.php file. You can also see a sample of this file here.

 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. * * @since 2.6.0 */ define('AUTH_KEY', 'put your unique phrase here'); define('SECURE_AUTH_KEY', 'put your unique phrase here'); define('LOGGED_IN_KEY', 'put your unique phrase here'); define('NONCE_KEY', 'put your unique phrase here'); define('AUTH_SALT', 'put your unique phrase here'); define('SECURE_AUTH_SALT', 'put your unique phrase here'); define('LOGGED_IN_SALT', 'put your unique phrase here'); define('NONCE_SALT', 'put your unique phrase here'); /**#@-*/ /** * WordPress Database Table prefix. * * You can have multiple installations in one database if you give each * a unique prefix. Only numbers, letters, and underscores please! */ $table_prefix = 'wp_'; /** * For developers: WordPress debugging mode. * * Change this to true to enable the display of notices during development. * It is strongly recommended that plugin and theme developers use WP_DEBUG * in their development environments. * * For information on other constants that can be used for debugging, * visit the Codex. * * @link https://codex.wordpress.org/Debugging_in_WordPress */ define('WP_DEBUG', false); /* That's all, stop editing! Happy blogging. */ /** Absolute path to the WordPress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); /** Sets up WordPress vars and included files. */ require_once(ABSPATH . 'wp-settings.php');

Each section of wp-config.php file is well documented in the file itself. Almost all settings here are defined using PHP Constants.

define( 'constant_name' , 'value');

Источник

Читайте также:  Python connect to linux server

How to Edit wp-config.php File in WordPress Without FTP

Disclosure: This content is reader-supported. If you click on our links, we may earn a small commission.

How to Edit wp-config.php File from within WordPress without FTP?

Have you read a tutorial that asks you to edit the wp-config.php file, and you don’t know what it is? In this article, I’ll teach you how you can easily edit wp-config.php file from within WordPress Admin Panel without FTP access.

What is wp-config.php file?

wp-config.php is one of the most important WordPress core files. It is the configuration file of WordPress and does not come with WordPress, but it is generated by WordPress during the installation process.

This file contains important info like your WordPress database name, user, password, database host, db table prefix and much other important info. So you don’t have to edit this sensitive file unless you don’t have another choice.

Where is wp-config file?

WordPress configuration file (wp-config.php) is located in your WordPress installation directory. You can edit your blog wp-config.php file through WordPress hosting cPanel » File Manager and find the file called wp-config.php and click Edit.

Editing wp-config.php file from Within WordPress Admin Panel

The most common way to edit this file is to access your WordPress hosting space via cPanel File Manager or an FTP agent like FileZilla. In some cases, WordPress users either don’t have access to FTP server or just want to edit wp-config.php file from within WordPress Admin Panel. Below I’ll mention 2 plugins that give you the ability to edit your WordPress configuration file (wp-config.php) directly from within WordPress Admin panel.

NOTE: You should backup your wp-config.php file before editing it.

WP Config File Editor WordPress plugin

WP Config File Editor WordPress plugin

This is the best plugin to edit wp-config.php file from within WordPress Admin panel. This free plugin gives you the ability to modify many wp-config.php values from WordPress admin dashboard using simple form.

Читайте также:  Mr. Camel

Config Constants WordPress plugin

The second plugin that you can use to edit wp-config.php file from WordPress Admin dashboard is Config Constants WordPress plugin. This plugin allows you to modify 9 wp-config.php constants including: WP_DEBUG, WP_DEBUG_LOG, WP_DEBUG_DISPLAY, SCRIPT_DEBUG, CONCATENATE_SCRIPTS, SAVEQUERIES and more.

NOTE: This plugin hasn’t been updated in over 2 years. And may have compatibility issues with newer WordPress versions. So I suggest that you use the WP Config File Editor plugin or edit the wp-config.php file manually.

If you have any problem or want to add anything, feel free to use comments below.

Источник

Оцените статью