Wp Config.php
WordPress saves every change you make to a post. If you run a large site, this can bloat your database.
// Limit post revisions to 3 define( 'WP_POST_REVISIONS', 3 );
// Or disable revisions entirely define( 'WP_POST_REVISIONS', false );
By mastering wp-config.php, you move from being just a WordPress user to a WordPress administrator who has full control over their site's performance and security.
If you get "Fatal Error: Allowed memory size exhausted," try increasing the limit: wp config.php
define( 'WP_MEMORY_LIMIT', '256M' );
At a minimum, a valid wp-config.php must define these constants:
// Database connection details define( 'DB_NAME', 'your_database_name' ); define( 'DB_USER', 'your_database_user' ); define( 'DB_PASSWORD', 'your_secure_password' ); define( 'DB_HOST', 'localhost' ); // often 'localhost' or a specific IP// 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' ); WordPress saves every change you make to a post
// Database table prefix (security through obscurity) $table_prefix = 'wp_';
// Absolute path to WordPress directory if ( ! defined( 'ABSPATH' ) ) define( 'ABSPATH', DIR . '/' ); By mastering wp-config
// Finally, load the WordPress engine require_once ABSPATH . 'wp-settings.php';