Wp Config.php !new! -
// ** MySQL settings ** // /** The name of the database for WordPress */ define( 'DB_NAME', 'wordpress' );
define( 'WP_POST_REVISIONS', false ); // Or limit to 3 revisions: define( 'WP_POST_REVISIONS', 3 );
WP_MEMORY_LIMIT handles front-end requests, while WP_MAX_MEMORY_LIMIT configures the backend admin dashboard area. Managing Post Revisions wp config.php
By leveraging these configuration tweaks, you can significantly enhance your WordPress site's performance, stability, and security framework.
// Enable debugging mode define( 'WP_DEBUG', true ); // Prevent errors from displaying visibly on the front-end to visitors define( 'WP_DEBUG_DISPLAY', false ); // Write all application errors quietly to a private file log (/wp-content/debug.log) define( 'WP_DEBUG_LOG', true ); Use code with caution. // ** MySQL settings ** // /** The
⚠️ : Always set WP_DEBUG to false on live production sites. Leaving it enabled can expose sensitive file paths and database structure to visitors.
The wp-config.php file is the most important configuration file in a WordPress installation. It acts as a bridge between your WordPress file system and your database, housing core security keys, database connection details, and developer performance tweaks. Because it controls the fundamental behavior of your website, understanding how to configure, optimize, and secure it is a vital skill for any WordPress administrator. ⚠️ : Always set WP_DEBUG to false on
// Unique authentication keys and salts (generated from WordPress.org API) define( 'AUTH_KEY', 'put your unique phrase here' ); define( 'SECURE_AUTH_KEY', 'put your unique phrase here' ); define( 'LOGGED_IN_KEY', 'put your unique phrase here' ); define( 'NONCE_KEY', 'put your unique phrase here' ); define( 'AUTH_SALT', 'put your unique phrase here' ); define( 'SECURE_AUTH_SALT', 'put your unique phrase here' ); define( 'LOGGED_IN_SALT', 'put your unique phrase here' ); define( 'NONCE_SALT', 'put your unique phrase here' );
define( 'WP_MEMORY_LIMIT', '256M' ); define( 'WP_MAX_MEMORY_LIMIT', '512M' ); Use code with caution.
❌ ✅ Add wp-config.php to .gitignore or use environment variables (e.g., $_ENV['DB_PASSWORD'] with packages like vlucas/phpdotenv ).
This file executes before the rest of the WordPress core loads. It defines PHP constants that tell WordPress how to connect to the database, how to handle errors, how to manage memory, and how to execute automatic updates. 1. Database Connection Settings