wp-config.php should remain the source of truth for core WordPress configuration, while WordPress Site Health should be treated as a reporting and warning tool. One changes how the site behaves. The other explains what may be wrong. A careful administrator uses both, but not for the same job. Mixing them up can lead to wasted time, false confidence, or broken settings after a rushed edit.
TLDR: wp-config.php is best for direct control over database details, security keys, debugging, memory limits, file editing rules, and environment constants. WordPress Site Health is best for spotting problems, such as outdated PHP, missing modules, failed loopback requests, or low server resources. For example, a site owner managing 40 WooCommerce sites may find that 65% of performance warnings appear first in Site Health, but the real fix often requires a host setting or a line in wp-config.php. Site Health points to the smoke; wp-config.php may control the fire.
What wp-config.php Actually Controls
wp-config.php is one of the most sensitive files in a WordPress installation. It sits in the root directory and loads before most WordPress features. Because of that, it controls settings that must exist before the admin dashboard can even work.
Common settings inside wp-config.php include:
- Database name, username, password, and host
- Authentication keys and salts for login security
- Debug mode, such as
WP_DEBUG - Memory limits, such as
WP_MEMORY_LIMIT - Automatic update behavior
- File editing rules, such as disabling theme and plugin editors
- Multisite settings
- Custom paths, URLs, and environment flags
This file is powerful because it is direct. It is also unforgiving. A missing quote or semicolon can take a working site down in seconds. Honestly, it feels like WordPress gives enormous power through a plain text file, then offers very little protection when someone edits it at 11:58 p.m.
What WordPress Site Health Does
WordPress Site Health is found inside the dashboard under Tools > Site Health. It checks the site and reports issues in plain language. It can flag security problems, server limits, missing PHP extensions, REST API failures, background update problems, and performance concerns.
Site Health does not usually apply deep configuration changes by itself. It observes. It reports. It recommends. For many nontechnical users, that is useful. For developers and agencies, it is a quick first scan before deeper testing begins.
Site Health commonly reports on:
- PHP version and whether it is outdated
- SSL status and HTTPS behavior
- REST API availability
- Loopback request errors
- Scheduled event problems
- Inactive themes and plugins
- Database server version
- Object cache and persistent cache status
The catch is that Site Health can be vague. It may say that a scheduled event failed, but not always why. It may warn about a missing PHP module, while the actual fix sits in a hosting control panel. Expect to waste ten extra minutes checking server logs when the dashboard message is too broad.
wp-config.php vs Site Health: The Key Difference
The main difference is simple. wp-config.php changes configuration. Site Health evaluates configuration.
When an administrator adds define( 'WP_DEBUG', true );, WordPress changes behavior. Debug messages may appear. Errors may be logged. Development work becomes easier. That is direct control.
When Site Health says the REST API is not reachable, it is not fixing the REST API. It is alerting the site owner that something blocks it. The cause might be a security plugin, a server firewall, bad permalinks, or a theme conflict.
This distinction matters. A team that treats Site Health as a control panel may wait for options that do not exist. A team that treats wp-config.php as a casual settings screen may break the site.
When wp-config.php Is the Better Tool
wp-config.php is the better choice when the setting must load early or remain locked away from the dashboard. Security-related settings often belong there.
Good use cases include:
- Disabling file edits:
define( 'DISALLOW_FILE_EDIT', true ); - Turning on debug logging:
define( 'WP_DEBUG_LOG', true ); - Raising memory limits:
define( 'WP_MEMORY_LIMIT', '256M' ); - Setting a custom uploads path on a managed setup
- Forcing SSL in admin with
FORCE_SSL_ADMIN - Defining environment type:
WP_ENVIRONMENT_TYPE
Agencies often use wp-config.php to keep staging, production, and local sites consistent. For instance, a development copy may have debugging enabled, while production has logging only and no public error display. This split protects users from ugly error messages and protects developers from guessing.
When Site Health Is the Better Tool
Site Health is better when an administrator needs a quick overview without touching code. It is safer for audits, onboarding, and support checks. A support technician can ask for the Site Health info screen and get server versions, active theme details, database information, and WordPress constants without FTP access.
Site Health also helps nontechnical site owners understand risk. A red warning about an old PHP version is easier to process than a raw server report. A message about missing HTTPS can push action faster than a buried hosting notice.
Still, Site Health should not be treated as the final truth. Some hosts disable functions. Some plugins alter checks. Some warnings are harmless in a specific setup. A staging site, for example, may intentionally block search engines or background requests.
How They Work Best Together
The strongest setup uses Site Health as the first inspection point and wp-config.php as one of the controlled fix locations. This workflow saves time.
- Check Site Health for warnings and server details.
- Confirm the cause with logs, hosting tools, or plugin testing.
- Apply config changes in
wp-config.phponly when needed. - Retest Site Health after the change.
- Document the edit so the next admin understands it.
A practical case: a membership site sees memory errors during checkout. Site Health shows low memory and several failed scheduled tasks. The administrator raises WP_MEMORY_LIMIT from 128M to 256M in wp-config.php, then asks the host to raise the server limit as well. Checkout errors drop by 38% over the next week. Site Health helped spot the issue, but the lasting fix required configuration.
Security and Backup Rules
Before editing wp-config.php, an administrator should create a backup. The file contains database credentials, so it should not be shared in tickets, screenshots, or public repositories. Permissions should be strict. On many servers, 400 or 440 may work, though hosting setups vary.
Site Health is less risky, but its copied report may still reveal paths, server details, plugin lists, and other sensitive facts. Teams should treat that data with care.
Best Practice Verdict
Use wp-config.php for fixed, technical, and early-loading settings. Use Site Health for checks, warnings, and support visibility. Neither replaces the other. The best administrators keep configuration controlled, test changes on staging, and use Site Health to catch problems before users complain.
FAQ
Can Site Health edit wp-config.php?
No. Site Health mainly checks and reports. It may suggest changes, but direct edits to wp-config.php must be done through file access, deployment tools, or a hosting file manager.
Is wp-config.php safe to edit?
Yes, if handled carefully. A backup should exist first. Even a tiny syntax error can break the site, so edits should be tested before production use.
Which tool is better for fixing performance issues?
Site Health is better for spotting common performance warnings. wp-config.php is better when the fix involves memory, caching constants, debugging, or environment settings.
Should beginners use wp-config.php?
Beginners should avoid casual edits. They can read guides and use Site Health first. If a file change is needed, a developer or host support team should review it.
Does a “Good” Site Health score mean the site is perfect?
No. It only means WordPress did not detect certain known issues. Speed, security, code quality, and hosting health still need separate checks.