Why PHP Warnings May Appear on Local Sites After WordPress 7.2
WordPress 7.2 changes the default value of WP_DEBUG for sites marked as local. As described in the developer notes, when WordPress recognizes the environment type as local and WP_DEBUG has no explicit value, debugging defaults to on. If you are testing the upcoming release on your workstation, that change can make existing PHP notices, warnings, and deprecation messages visible for the first time. The cause of a specific warning still needs to be investigated.
Check whether the new default applies.
Look for WP_ENVIRONMENT_TYPE in your local configuration or in the environment settings provided by your development tool. This change only affects a site running on your computer if WordPress identifies it as local. Then check whether wp-config.php already defines WP_DEBUG. An explicit value takes precedence over the new default. Please check for an existing definition before adding one to ensure you have a single setting to maintain.
The developer note describes the default as already enabled for development and still disabled for staging and production, subject to explicit configuration and development mode. Keep the settings for each environment separate. If someone reports warnings on a public site, confirm its actual environment type and debug configuration before assuming this local default explains what happened.
Log warnings without showing them on the page.
For local development, you may want to preserve the messages while keeping the page clear for layout checks. The developer note shows how to enable debugging and logging while turning off display. In your local wp-config.php, set WP_DEBUG and WP_DEBUG_LOG to true and WP_DEBUG_DISPLAY to false. Update existing definitions where present. Then reload a page that produced a warning and check the log. Keep local logs out of public deployments and review them for sensitive information before sharing them.
If you prefer the previous behavior on a particular local site, explicitly set WP_DEBUG to false. Make that a conscious choice after recording any warning you need to investigate. A warning that stops appearing after a configuration change can still point to code that warrants a compatibility check.
Examine one workflow at a time.
Start with the exact page or editor action where you first saw the message. Note the WordPress and PHP versions, active theme, and relevant plugin versions. Reload once, then compare the latest log entry with the action you took. If a warning points to a plugin or theme, check its release notes and repeat the test in a disposable copy before contacting support.
WordPress 7.2 is still in its release candidate cycle as of November 29. Use this guide for local pre-release testing and recheck the developer notes when the stable version ships.
