Set DISALLOW_FILE_EDIT to true
WARNING: Changing this setting writes to wp-config.php. Verify that the file is writable, that the site has a recovery path, and that configuration management or deployment tooling will not immediately overwrite the change.
Description of the control
This control sets the desired value of DISALLOW_FILE_EDIT in the wp-config Hardening section of the Core Hardening page. The same section also shows the detected wp-config.php path, current writability status, and a Check wp-config.php permissions button.
Use this control when the site should keep the DISALLOW_FILE_EDIT constant enabled in wp-config.php.
Procedure
- In WordPress admin, open Posture Management.
- Select Core Hardening.
- In the wp-config Hardening section, review the detected
wp-config.phppath and file status. - Click Check wp-config.php permissions if you want to verify that the file can be updated.
- Select Set DISALLOW_FILE_EDIT to true.
- Click Save changes.
Validation
After saving, reload Posture Management -> Core Hardening and confirm that Set DISALLOW_FILE_EDIT to true remains selected.
If needed, use Check wp-config.php permissions again and verify that the file is still accessible and that the control continues to show the expected saved state.
