wp-config.php Snippet Generator

Assemble a wp-config.php configuration snippet from the most commonly used constants: debug mode, memory limit, disabling the file editor, blocking updates, post revisions and autosave. Tick the options, set the values and paste the ready-made block into the file. Everything is computed in your browser, nothing is sent.

Enables PHP error reporting. For diagnosing problems; in production it is best to log to a file and not show errors on the page.

Disables the built-in theme and plugin editor in the dashboard. A recommended safeguard that limits the impact of a compromised admin account.

Completely blocks installing, updating and deleting plugins and themes from the dashboard. A strong safeguard, but it hinders day-to-day work. Enable deliberately.

Forces an encrypted connection when logging in and in the dashboard. Enable only when the site works correctly over HTTPS.


                    
Paste the block into wp-config.php above the /* That's all, stop editing! */ line. Constants placed below it will not work. Make a backup of the file before editing.

What wp-config.php is

wp-config.php is the main WordPress configuration file, located in the root directory of the installation. It contains the database access details, security keys and constants (define statements) that control the system's behavior. With them you enable debug mode, raise the memory limit, disable the file editor or limit the number of post revisions. It is one of the first places where WordPress is tailored to a project's needs, and at the same time an element of security and performance.

What is worth setting and why

Debug mode In production, enable WP_DEBUG together with logging to a file (WP_DEBUG_LOG) and without showing errors to visitors (WP_DEBUG_DISPLAY off). This way you diagnose problems without exposing technical details.
Memory limit Raising WP_MEMORY_LIMIT helps with large sites and stores when the default limit is not enough. The admin area tends to be more memory-hungry, hence a separate WP_MAX_MEMORY_LIMIT.
Disabling the file editor DISALLOW_FILE_EDIT is a simple, strong security win: if an admin account is compromised, an attacker cannot inject code through the built-in theme and plugin editor.
Revisions and autosave Limiting the number of revisions (WP_POST_REVISIONS) reduces database bloat. Extending the autosave interval eases server load during long editing. It ties into database optimization.
Automatic updates WP_AUTO_UPDATE_CORE lets you choose the scope of automatic core updates. For most sites the minor mode (minor and security) is sensible. Related to WordPress updates.

Frequently asked questions about wp-config.php

The main WordPress configuration file in the root directory. It contains the database details, security keys and define constants controlling the system's behavior: debug, memory, file editor, updates and more.

Above the "That's all, stop editing! Happy publishing" line. Constants below it will not work, because WordPress loads the configuration up to that point. Back up the file first.

Temporarily, for diagnosis. In production it is best to use WP_DEBUG with WP_DEBUG_LOG (write to a file) and WP_DEBUG_DISPLAY off, so errors go to the log rather than to visitors. Turn debug off afterwards.

Set to true it disables the built-in theme and plugin editor in the dashboard. A recommended safeguard: if an admin account is compromised, it makes injecting code through the editor harder.

Yes, a PHP syntax error makes the site unavailable. Back up the file before editing, paste complete define lines, and do not leave unclosed brackets or quotes. If a problem occurs, restore the backup.

Tool and write-up: Marcin Szewczyk-Wilgan, WebOptimo. Constants conform to the official WordPress documentation. The generator runs in your browser, with no data sent.

We'll configure your WordPress

Hardening, performance, server configuration and WordPress site care. No obligation — a concrete proposal after a short conversation.

Phone

+48 608 271 665

Mon–Fri, 8:00–16:00

E-mail

kontakt@weboptimo.pl

We reply within 24h

Company

WebOptimo

VAT ID: PL6391758393