wp-config.php settings generator
Tick the settings you want and copy the lines. Each one comes with a short note, the default WordPress uses, and a warning if it can hurt your site.
Everything you type stays in your browser. Nothing is sent or saved. This tool never asks for database names, users or passwords.
Your lines
Nothing yet. Tick a setting to add it. Settings you leave unticked stay as they are.
How to use it
- Make a copy of
wp-config.phpand keep it. If anything goes wrong, put the copy back. - Open the file and find the line
/* That's all, stop editing! Happy publishing. */. Paste the lines just above it. - If the file already has a line for the same setting, change that line. Do not add a second one. PHP shows “Constant X already defined” and keeps the first value.
- Save. If you have a terminal, check the file with
php -l wp-config.php. It should say “No syntax errors detected”. - Reload your site and open Tools → Site Health → Info to see the new values.
How it works
wp-config.php holds settings WordPress reads before anything else. Each is a line like define( 'WP_DEBUG', true );. This tool writes those lines and checks your values, so a typo such as 256MB is caught here and not on your live site.
What it does
- It writes only the lines you tick. Everything starts unticked. The style matches the sample file that comes with WordPress.
- It shows each default, taken from the WordPress wp-config.php page. Where that page gives no number, the value was read on a fresh WordPress 7.1.4 site.
- It leaves out a line that would do nothing, or that another line already covers, and tells you why.
What it does not do
- It does not write the whole file or ask for database details. Leave those lines in your file alone.
- It does not make security keys and salts. Use the salt generator for that.
- It does not read or change your site. You paste the lines yourself.
How to use the lines
- Copy
wp-config.phpto a safe place first. If the site breaks, put the copy back. - Open the file in your host’s file manager, over SFTP, or in a terminal. Paste the lines just above
/* That's all, stop editing! Happy publishing. */. - Search the file for each setting name first. If it is already there, change that line and do not paste a second one.
- Save, then reload the site. In a terminal,
php -l wp-config.phpshould print “No syntax errors detected”. One missing quote takes the whole site down. - Check the result in Tools → Site Health → Info, or with WP-CLI:
wp eval 'var_dump( WP_MEMORY_LIMIT );'.
Tested
We pasted the lines this tool wrote for WP_DEBUG, WP_DEBUG_LOG with a custom path, WP_ENVIRONMENT_TYPE, WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_POST_REVISIONS, AUTOSAVE_INTERVAL, EMPTY_TRASH_DAYS, DISALLOW_FILE_EDIT and WP_AUTO_UPDATE_CORE into a fresh WordPress 7.1.4 site (PHP 8.3). WordPress read back every value. A post saved six times kept three revisions. A second WP_DEBUG line gave the “already defined” warning and the first value won.
FAQ
Where do I paste the lines in wp-config.php?
Above the comment that says /* That's all, stop editing! Happy publishing. */. WordPress loads the rest of itself after that comment, so a line pasted below it is read too late.
I got “Constant already defined”. What now?
Your file already has a line for that setting. PHP keeps the first one and warns about the second. Change the value on the old line and delete the one you pasted. “Skip a line if the file already has it” hides the warning, but then your new value is ignored silently.
Is it safe to leave WP_DEBUG on?
No, not on a live site. WordPress can print errors on the page, and they show folder names from your server. Turn on WP_DEBUG_LOG, set WP_DEBUG_DISPLAY to false, and use a log path outside your website folder. The default wp-content/debug.log can be opened by address on many servers.
I set WP_MEMORY_LIMIT but nothing changed. Why?
WordPress only raises the limit when PHP allows less, and many hosts cap it themselves. Check Tools → Site Health → Info → Server for the limit PHP really uses. If it stays low, ask your host to raise it.
Why does the generator not ask for my database details?
You do not need them to change a setting, because they are already in your file. Typing a database password into a web form is a habit worth avoiding. For a new wp-config.php, copy wp-config-sample.php and fill it in on your own computer.