TOOL · FREE · RUNS IN YOUR BROWSERallwpcare.com/tools/wp-config-generator/
Free tool

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.

Start with
Debugging
Show PHP errors and deprecation notices. Also needed for the two debug options below.

Default: false · WordPress docs

Keep a list of errors in a file. Only works when debug mode is on.

Default: false. When true, the log is wp-content/debug.log. · WordPress docs

Set to false to hide errors from visitors. Only works when debug mode is on.

Default: true while debug mode is on · WordPress docs

Use the readable versions of core scripts and styles.

Default: false (minified files are used) · WordPress docs

Tells plugins whether this is a live, test or local site.

Default: 'production'. A value that is not on the list also gives 'production'. · WordPress docs

Stops WordPress from catching fatal errors and emailing you a recovery link.

Default: false (Recovery Mode is on) · WordPress docs

Memory
Raises the PHP memory limit for WordPress, only if PHP now allows less.

Default: 40M on a single site (64M on multisite) (read on WordPress 7.1.4) · WordPress docs

A higher limit used on admin screens, image work and updates.

Default: 256M, or the PHP memory limit if that is higher (read on WordPress 7.1.4) · WordPress docs

Content
How many old copies of a post WordPress keeps. Use false to keep none.

Default: true (keep every revision) (read on WordPress 7.1.4) · WordPress docs

How often the editor saves a draft copy while you write.

Default: 60 seconds (read on WordPress 7.1.4) · WordPress docs

How long deleted posts, pages and comments stay in the trash.

Default: 30 days (read on WordPress 7.1.4) · WordPress docs

Security
Hides the theme file editor and the plugin file editor.

Default: not defined (the editors are available) (read on WordPress 7.1.4) · WordPress docs

Also removes the file editor, so you do not need the option above.

Default: not defined (installs and updates are allowed) · WordPress docs

Sends logins and admin pages over HTTPS only.

Default: not defined · WordPress docs

Addresses
The address people type to reach your site. Overrides the saved setting.

Default: the Site Address saved in Settings → General · WordPress docs

The address where the WordPress files live. Overrides the saved setting.

Default: the WordPress Address saved in Settings → General · WordPress docs

The domain login cookies are set for. Rarely needed.

Default: not defined (WordPress works it out) · WordPress docs

Moves the wp-content folder. Full server path, no slash at the end.

Default: the wp-content folder inside the WordPress folder · WordPress docs

The web address of the wp-content folder. Use it together with the option above.

Default: the site address plus /wp-content · WordPress docs

Updates
'minor' installs security and maintenance releases only. true also installs major versions.

Default: 'minor' · WordPress docs

Core, plugins, themes and translations will not update by themselves.

Default: not defined (automatic updates follow your settings) · WordPress docs

Performance
Lets a caching plugin load its drop-in file early.

Default: not defined · WordPress docs

Choose false to stop joining them. That is a fix to try when JavaScript breaks on admin screens.

Default: true (scripts are joined) · WordPress docs

Temporary: remove after use
Opens wp-admin/maint/repair.php so you can repair damaged tables.

Default: not defined (the repair page is closed) · WordPress docs

Your lines

Nothing yet. Tick a setting to add it. Settings you leave unticked stay as they are.

How to use it

  1. Make a copy of wp-config.php and keep it. If anything goes wrong, put the copy back.
  2. Open the file and find the line /* That's all, stop editing! Happy publishing. */. Paste the lines just above it.
  3. 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.
  4. Save. If you have a terminal, check the file with php -l wp-config.php. It should say “No syntax errors detected”.
  5. Reload your site and open Tools → Site Health → Info to see the new values.
0 linesSee lines

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

  1. Copy wp-config.php to a safe place first. If the site breaks, put the copy back.
  2. 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. */.
  3. Search the file for each setting name first. If it is already there, change that line and do not paste a second one.
  4. Save, then reload the site. In a terminal, php -l wp-config.php should print “No syntax errors detected”. One missing quote takes the whole site down.
  5. 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.