Editing your WordPress wp-config.php File

The wp-config.php file contained in the root of your WordPress install directory contains all the configuration items for connecting and interacting with WordPress.  The most important information it contains is the credentials for connecting to the MySQL database which without this you’d just see an white page with an error message saying “Database Not Found.  Let’s look at editing your wp-config.php file so see how we can customize WordPress to suit your needs.

Editing your WordPress wp-config File

Choose your favorite text editor to accomplish this, I like Notepad++ .  Take care when editing your wp-config.php file because entering the wrong data can break your site.

editing wp-config.php file
Take care when editing your wp-config.php file

Post Revisions

You can turn off post revisions all together in WordPress or specify how many post revisions you want to store in the database by editing wp-config.php

Autosave Interval

WordPress seems to be a little to trigger happy when it comes to saving with it default settings.  Increase the save period with this wp-config.php snippet.

Automated Trash Emptying

I hate seeing my trash folder full of junk so why not modify your wp-config.php file to empty the trash for you automatically!

Bypass the trashcan all together with this line!


Increase PHP Memory

If you ever receive an error message stating “Allowed memory size of xxxx bytes exhausted” adding this line to wp-config.php might resolve the issue.

WordPress Debug

Always enable this in wp-config.php when you are building a new site so you can fix any errors that may go unseen.  This piece of configuration will write to a physical log file and not display the errors on screen.




Leave a Reply

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