wp-config.php is a configuration file located in the root directory of your WordPress installation folder. This is one of the most important files in your WordPress installation since it contains the base configuration details of your website. And so you may need to edit it from time to time to enable/disable various options. In this article, I will show you the easiest way to edit the wp-config.php file in WordPress.
How to Edit wp-config.php in WordPress
The easiest way to edit wp-config.php in WordPress is to download the file to your Desktop via FTP and open it with a text editor such as Notepad. For FTP, I would recommend a free file transfer client like FileZilla: https://filezilla-project.org/.
Download and install the FileZilla FTP client on your computer.
Open FileZilla once installed and click File > Site Manager… to configure a new site.
Enter your domain name in the Host field. You can use either FTP/sFTP to connect to your server (check the FTP details provided by your web host). Your FTP details are usually sent to the welcome email when you sign up with a hosting provider. If you don’t have it contact them.
Set the Logon Type to Normal and enter your FTP username and password. Click Ok to save the settings.
You can now easily connect to your web server from the Site Manager window. Make sure to set the Date type to binary so you don’t experience any formatting issue (Transfer > Manual transfer > Data type).
Navigate to the root of your WordPress installation directory. It’s usually in the public_html folder.
Select the wp-config.php file and download it to your computer.
Open the wp-config.php file using a text editor (e.g. Notepad) and do all the editing that you need. Save it when you are done.
Transfer the updated wp-config.php file back to the server using the Upload command.
How to Limit the Number of Post Revisions
In order to limit the number of post revisions that WordPress stores, you can use the WP_POST_REVISIONS constant. For example,
define( 'WP_POST_REVISIONS', 5 );
This will make sure that WordPress only stores the last 5 revisions of a post on your website.
How to Increase PHP Memory Limit
In order to increase the memory allocated to PHP in WordPress, you can use the WP_MEMORY_LIMIT constant. For example,
define( 'WP_MEMORY_LIMIT', '64M' );
This will set the PHP memory allocated for WordPress to 64MB.
How to Disable WordPress Auto Updates
In order to disable all automatic updates in WordPress, you can set the AUTOMATIC_UPDATER_DISABLED constant to true. For example,
define( 'AUTOMATIC_UPDATER_DISABLED', true );
How to Disable WordPress Core Updates
In order to control how WordPress core updates are installed on your site, you can use the WP_AUTO_UPDATE_CORE constant. For example,
define( 'WP_AUTO_UPDATE_CORE', false );
This constant will disable all core updates in WordPress.
define( 'WP_AUTO_UPDATE_CORE', true );
This will enable all core updates in WordPress, including major and minor.
define( 'WP_AUTO_UPDATE_CORE', 'minor' );
This will enable core updates for minor releases.