The “famous 5-minute installation” is a marketing slogan, not a professional standard. A default WordPress installation is chatty, unoptimized, and often insecure.
As developers, we don’t just “install” WordPress; we provision it. This guide covers the essential configuration constants and hardening techniques that should be in your boilerplate for every client project in 2026.
1. The power of wp-config.php
This is the brain of your installation. Stop leaving it at default.
Environment control
Since WordPress 5.5, WP_ENVIRONMENT_TYPE is standard. Use it to prevent development errors from leaking into production.
// In wp-config.php
define( 'WP_ENVIRONMENT_TYPE', 'production' ); // 'local', 'development', 'staging', 'production'
Then in your code:
if ( wp_get_environment_type() === 'production' ) {
// Enable Caching, Disable Errors
}
Hardening security
Prevent clients (or hackers) from breaking the site via the dashboard.
// Disable File Editor (Theme/Plugin Editor)
define( 'DISALLOW_FILE_EDIT', true );
// Prevent Plugin/Theme Installation/Updates (Good for immutable deployments)
define( 'DISALLOW_FILE_MODS', true );
// Force SSL Admin
define( 'FORCE_SSL_ADMIN', true );
Post revisions
Database bloat killer. Do you really need 100 versions of “About Us”?
define( 'WP_POST_REVISIONS', 10 ); // Keep last 10
// OR
define( 'WP_POST_REVISIONS', false ); // Disable completely (Not recommended)
2. Professional debugging
Never display errors on the frontend. Log them.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', '/tmp/wp-errors.log' ); // Move log outside web root!
define( 'WP_DEBUG_DISPLAY', false );
// Log SQL queries for debugging performance (Turn off in production!)
define( 'SAVEQUERIES', false );
3. Cleaning up “core bloat”
WordPress comes with features that 90% of business sites don’t need: Emojis, oEmbeds, and XML-RPC.
Do not install a plugin to disable them. Create a Must-Use Plugin (wp-content/mu-plugins/lean-core.php).
<?php
/* Plugin Name: Lean Core */
// 1. Disable Emojis (Saves HTTP request)
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
// 2. Disable XML-RPC (Security)
add_filter( 'xmlrpc_enabled', '__return_false' );
// 3. Remove WP Version (Security by Obscurity)
remove_action( 'wp_head', 'wp_generator' );
// 4. Disable RSS Feeds (If building a brochure site)
// function wppoland_disable_feed() {
// wp_die( 'No feed available, please visit our homepage!' );
// }
// add_action('do_feed', 'wppoland_disable_feed', 1);
4. The “salts” myth
You know the authentication keys in wp-config.php.
define('AUTH_KEY', 'put your unique phrase here');
// ...
Fact: Changing these immediately logs out all users. It is the “Nuclear Option” if a site is hacked. Pro Tip: Automate their rotation using a CLI script or Vault if you manage enterprise sites.
5. Summary checklist
Before you launch:
- Set
WP_ENVIRONMENT_TYPEto production. - Set
DISALLOW_FILE_EDITto true. - Limit
WP_POST_REVISIONS. - Move
WP_DEBUG_LOGto a private folder. - Disable Emojis/XML-RPC via code.
A well-configured WordPress instance is silent, secure, and fast.



