Wp Config.php -

define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/new-location/content' );
define( 'WP_CONTENT_URL', 'https://example.com/new-location/content' );

By default, WordPress keeps items in the trash for 30 days. You can customize this:

// Empty trash every 7 days
define( 'EMPTY_TRASH_DAYS', 7 );
<?php
// Database settings (use strong credentials)
define( 'DB_NAME', 'prod_db' );
define( 'DB_USER', 'prod_user' );
define( 'DB_PASSWORD', 'complex_pass_here' );
define( 'DB_HOST', 'localhost' );

// Unique salts (generated from WordPress.org) define( 'AUTH_KEY', '...' ); define( 'SECURE_AUTH_KEY', '...' ); // ... all 8 salts

// Table prefix (not default) $table_prefix = 'x7t_';

// Security hardening define( 'FORCE_SSL_ADMIN', true ); define( 'DISALLOW_FILE_EDIT', true ); define( 'DISALLOW_FILE_MODS', false ); // allow plugin updates wp config.php

// Performance define( 'WP_MEMORY_LIMIT', '256M' ); define( 'WP_CACHE', true );

// Debug off in production define( 'WP_DEBUG', false );

// Absolute path to WordPress root if ( ! defined( 'ABSPATH' ) ) define( 'ABSPATH', DIR . '/' ); define( 'WP_CONTENT_DIR', dirname(__FILE__)

// Sets up WordPress vars and included files require_once ABSPATH . 'wp-settings.php';


For security, you can move wp-content to a different location. By default, WordPress keeps items in the trash for 30 days

define( 'WP_CONTENT_FOLDERNAME', 'custom-content' );
define( 'WP_CONTENT_DIR', ABSPATH . 'custom-content' );
define( 'WP_CONTENT_URL', 'https://' . $_SERVER['HTTP_HOST'] . '/custom-content' );

When you install WordPress, wp-config.php is one of the most critical files in your directory structure. It acts as the bridge between your website files and your database. Without it, WordPress simply cannot function.

While the file is automatically generated during installation, manually editing it allows you to unlock powerful features, troubleshoot errors, and significantly harden your site’s security.

Here is everything you need to know about mastering wp-config.php.