Inside WordPress Config File

Hidden Features

The wp-config.php file is one of the most important files related to your WordPress installation, however, there is so much more to it than just the place your database settings are stored. See what else you have in your WordPress Config file. Frankly, most developers completely overlook many of the awesome features hidden within the wp-config.php file.

This tutorial is designed to showcase some of the lesser-known functions and features that you can make use of with just a few simple lines of code added to your wp-config.php file. Features that are commonly handled by plugins – creating a less-than-clean WordPress installation.

Inside WordPress Config File

Hidden Features Inside WordPress Config File

Forcing SSL Use For Logins & Admin Backend

When it comes to transmitting passwords and other sensitive information through a browser, an SSL connection is key. As such you might want to enable SSL for your login pages and/or for your WordPress admin backend. Rather than installing any plugins for this, you can accomplish both needs with a few simple lines of code:

Turn Post Revisions On/Off & Set Their Limits

Post revisions can be extremely helpful if you accidentally make the wrong change to a page/post and end up breaking things. However WordPress, by default, doesn’t set a limit on post revisions and this can add up to quite a large database over time. Once again you can easily control this with your wp-config.php file:

Control Memory Use

Hidden Features Inside WordPress Config File

Memory control is usually something that most webmasters will end up dealing with during the course of running a WordPress website. Your website’s wp-config.php file lets you set two different limits. One attempts to set the PHP memory limit – something you would normally do with your PHP.ini file.

The PHP memory limit is set to 30M in default WordPress installs. The other option lets you set the maximum memory that WordPress should use – which is set to 256M by default. Should the need for more memory arise, just add the following lines to your wp-config.php file:

Setup A Recycle/Trash Bin For Your Media

Hidden Features Inside WordPress Config File

Ever deleted a media file and immediately realized you made a massive mistake and had absolutely no backup of that image? This is why WordPress created the Trash bin – something that is enabled by default for Posts/Pages however not for Media items. Luckily this is a quick fix away!

/* Turn On Media Trash. */
define('MEDIA_TRASH',true);

Hopefully this tutorial taught you something new, and maybe even helped you get rid of a plugin or two – thus simplifying your WordPress install! As always post any questions you have in the comments below!