wp-config.php – WordPress configuration

Unlock the full potential of WordPress with wp-config.php! Dive into configurations & explore a list of definitions to tweak your site!

So, we鈥檙e talking about wp-config.php, a fundamental buddy in your WordPress journey. Think of it as the brain of your WordPress installation, sitting comfortably in the main folder. It鈥檚 the keeper of secrets, holding all the juicy details like database info, hostname, username, and password. It鈥檚 the maestro conducting the symphony of communications between WordPress and the database, making sure all your precious data like posts, users, settings, and more are in harmony! 馃幎 But wait, there鈥檚 more!

This file isn鈥檛 just a one-trick pony; it鈥檚 also the guardian of advanced WordPress options. Tweaking settings in wp-config.php is like giving WordPress a superpower boost, enhancing security, and performance, making your life a tad bit easier when working with WordPress.

And because I know we all have a lot on our plates and remembering every variable in the wp-config.php file can be a bit of a headache, I鈥檝e compiled a handy list of all of them right here! 馃摑 Keep it fun, keep it simple, and let鈥檚 make WordPress work for us!

PHP Memory Limit

// Limit pami臋ci PHP dla tej witryny
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Zwi臋kszenie limitu pami臋ci dla strony administratora.


// Baza danych
define( 'WP_ALLOW_REPAIR', true ); // Pozw贸l WordPressowi automatycznie naprawia膰 baz臋 danych.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Nie wykonuj aktualizacji bazy danych w tabelach globalnych (np. u偶ytkownicy)

URL Address

define( 'WP_HOME', 'https://domena.pl' );
define( 'WP_SITEURL', 'https://domena.pl' );

Default Theme

define( 'WP_DEFAULT_THEME', 'twentytwentyone' );

Temporary site transfer settings

define( 'RELOCATE', true ); // Pami臋taj aby usun膮膰 po zalogowaniu si臋

WordPress file updates

define( 'FS_METHOD', 'direct' );
define( 'FS_CHMOD_DIR', ( 0755 & ~ umask() ) ); // zmiana uprawnie艅 katalog贸w
define( 'FS_CHMOD_FILE', ( 0644 & ~ umask() ) ); // zmiana uprawnie艅 plik贸w

Paths to content, plugins and themes

define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); // Pe艂ny adres URL do katalogu wp-content
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // Bez ko艅cowego uko艣nika, pe艂na 艣cie偶ka do wp-content
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // Pe艂na 艣cie偶ka, bez ko艅cowego uko艣nika.
define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // Pe艂ny adres URL, bez ko艅cowego uko艣nika.
define( 'PLUGINDIR', 'wp-content/plugins' ); // Powi膮zanie ABSPATH. Dla kompatybilno艣ci wstecznej.
define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // Pe艂na 艣cie偶ka, bez ko艅cowego uko艣nika.
define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // Pe艂ny adres URL, bez ko艅cowego uko艣nika.
define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Powi膮zanie ABSPATH. Dla kompatybilno艣ci wstecznej.
define( 'TEMPLATEPATH', get_template_directory() );
define( 'STYLESHEETPATH', get_stylesheet_directory() );

Post versions/revisions

define( 'WP_POST_REVISIONS', 15 ); // Liczba wersji
define( 'AUTOSAVE_INTERVAL', 60 ); // Interwa艂 automatycznego zapisywania wersji post贸w w sekundach.

Domain Cookies

Login Cookies

Very useful if you experience cookie-related errors when logging in.

define( 'COOKIE_DOMAIN', '.domena.pl' ); // Domena i wszystkie subdomeny
define( 'COOKIE_DOMAIN', 'domena.pl' ); // tylko domena g艂贸wna
define( 'COOKIE_DOMAIN', 'www.domena.pl' ); // tylko subdomena
define( 'COOKIEPATH',  $_SERVER['HTTP_HOST'] . '/' ); // Ustaw to dok艂adnie. 
define( 'SITECOOKIEPATH', $_SERVER['HTTP_HOST'] . '/' ); // Ustaw to dok艂adnie.
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
define( 'PLUGINS_COOKIE_PATH', preg_replace( '|https?://[^/]+|i', '', WP_PLUGIN_URL ) );
define( 'USER_COOKIE', 'wordpressuser_' . COOKIEHASH );
define( 'PASS_COOKIE', 'wordpresspass_' . COOKIEHASH );
define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH );
define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH );
define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH );
define( 'RECOVERY_MODE_COOKIE', 'wordpress_rec_' . COOKIEHASH );

Enabling and disabling WordPress debugging

Enabled is true, disabled is false

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_LOCAL_DEV', true ); // Magiczna zmienna dla local dev

Debugging scripts and styles

define( 'CONCATENATE_SCRIPTS', false ); // Powoduje, 偶e skrypty WordPress s膮 do艂膮czane osobno
define( 'SCRIPT_DEBUG', true ); // U偶ywa niezminimalizowanych skrypt贸w
define( 'SAVEQUERIES', true ); // Do analizy globalnych obiekt贸w $wpdb
define( 'COMPRESS_SCRIPTS', true ); 
define( 'COMPRESS_CSS', true );
define( 'ENFORCE_GZIP', true );

Force SSL

define( 'FORCE_SSL_LOGIN', true ); // Zabezpiecz tylko proces rejestracji / logowania
define( 'FORCE_SSL_ADMIN', true ); // Wymu艣 SSL dla panelu administratora WordPress

Disable cron

define( 'DISABLE_WP_CRON', true );
define( 'ALTERNATE_WP_CRON', true ); // alternatywna metoda uruchamiania crona w tle, gdy jest inicjowana przez u偶ytkownik贸w ko艅cowych.
define( 'WP_CRON_LOCK_TIMEOUT', MINUTE_IN_SECONDS ); // limit cron do dzia艂ania w okre艣lonym przedziale czasu.

File modifications

define( 'DISALLOW_FILE_EDIT', true ); // Wy艂膮cz edytor plik贸w WordPress
define( 'DISALLOW_FILE_MODS', true ); // Nie zezwalaj u偶ytkownikom na aktualizowanie rdzenia, wtyczek ani motyw贸w
define( 'IMAGE_EDIT_OVERWRITE', true ); // Zezw贸l na edycj臋 obraz贸w, aby zast膮pi膰 orygina艂y

WordPress Updates

define ('AUTOMATIC_UPDATER_DISABLED', true); // Wy艂膮cz wszystkie automatyczne aktualizacje WordPress
define ('WP_AUTO_UPDATE_CORE', false); // Wy艂膮cz tylko aktualizacje rdzenia
define ('WP_AUTO_UPDATE_CORE', 'minor'); // W艂膮cz tylko niewielkie aktualizacje rdzenia

Changing the WordPress language

define( 'WPLANG', 'pl_PL' );
define( 'WP_LANG_DIR', dirname(__FILE__) . 'wordpress/languages' );

Trash for WordPress

define ('EMPTY_TRASH_DAYS', 30); // Liczba dni oczekiwania przed opr贸偶nieniem kosza
define ('MEDIA_TRASH', false); // Czy zezwoli膰 elementom multimedialnym na korzystanie z funkcji kosza.

Recovery mode and critical error handling

define ('WP_SANDBOX_SCRAPING', true); // Wy艂膮cz ochron臋 WSOD (i nie wysy艂aj powiadomie艅 e-mail)
define ('WP_START_TIMESTAMP', microtime (true)); // Zmodyfikuj czas startu WordPressa.
define ('RECOVERY_MODE_EMAIL', 'email@domena.pl'); // Ustaw wiadomo艣膰 e-mail w trybie odzyskiwania.

Important information about wp-config.php

Tinkering with the wp-config.php variables can be a game-changer or a real headache! Before diving in, do yourself a favour鈥攎ake a backup! Just duplicate the file, name it wp-config.ok, and you鈥檙e good to go. If things go sideways, a quick rename will set things right.

Found this guide handy? If there鈥檚 a crucial variable I鈥檝e missed, don鈥檛 be shy鈥攄rop it in the comments below!

Did you know that by sharing this article you are helping me? Thanks for your support.
Tom Robak
Tom Robak

Tom Robak is a digital expert with over a decade of experience, specialising in WordPress, SEO, e-commerce, and optimising web performance. His unique skill set, rooted in sales, marketing, and photography, establishes him as a leading creator of customised online solutions.

Grab Your Web Wonders Digest!

Join my newsletter adventure for exclusive WordPress tips, SEO secrets, marketing insights, and some fun stories directly in your inbox!

Leave a Reply

Your email address will not be published. Required fields are marked *

Ready for your new website?

Feel free to book a free consultation, or just drop me an email. I'm excited to chat with you!

Free initial consultation

Write an email