Understanding the wp-config.php settings we use

wp-config.php holds WordPress's core configuration. If we set your site up, some of these will already be in place.

What is in there

  • Database details – name, user and password. Anyone with this file can read your whole site's data, which is why it should be 600 or 644 and never world-writable.
  • Security keys and salts – a block of long random strings used to sign cookies. Changing them logs everybody out immediately, which is a useful thing to do after a compromise.
  • Table prefix – usually wp_ but sometimes changed.

Settings we commonly add

define( 'DISABLE_WP_CRON', true );

Turns off WordPress's visitor-driven scheduler because we run a real scheduled task instead – see Why WP-Cron is disabled on our servers.

define( 'WP_POST_REVISIONS', 5 );

Caps revisions so the database does not grow without limit.

define( 'DISALLOW_FILE_EDIT', true );

Stops PHP files being edited through the admin, so a stolen login cannot immediately install a backdoor.

Editing it safely

Take a copy first. A single typo here takes the entire site down, because nothing loads without it. Add your own lines above the comment that says to stop editing, never below it. And never leave a blank line or a space after the closing PHP tag – that alone can produce a "headers already sent" error.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Why WP-Cron is disabled on our servers, and what replaces it

WordPress has its own scheduling system, WP-Cron, which runs scheduled tasks – publishing...

Object caching, and why Redis is not available here

WordPress can store the results of database queries in memory so that repeated requests do not...

Moving an existing WordPress site to us

A move goes wrong in predictable ways. Doing it in this order avoids all of them. 1. Set the...

The white screen of death: how to diagnose it

A completely blank page means PHP stopped part-way through and had nothing to show. The page...

Locked out of wp-admin: how to get back in

There are several routes back in depending on what is wrong. All of them need cPanel access, so...