WordPress debug.log full of "Deprecated" notices – should you worry?
A deprecation notice means "this still works, and a future PHP version will remove it". The site is not broken. Worry about three things: notices that leak into page output, a log that grows without limit, and the plugin behind the notices being unmaintained.
Reading the notice
PHP Deprecated: strlen(): Passing null to parameter #1 ($string) of type string
is deprecated in /wp-content/plugins/some-plugin/inc/helpers.php on line 210
Three facts in every line: what is deprecated, which plugin, which line. The wording tells you which PHP version introduced it:
| Notice | Since | What it is |
|---|---|---|
| Passing null to parameter … of type string | 8.1 | null given to a built-in string function |
| Creation of dynamic property | 8.2 | Class writes a property it never declared |
| Using ${var} in strings | 8.2 | Old string interpolation syntax |
| Function utf8_encode() is deprecated | 8.2 | Function scheduled for removal |
| Calling get_class() without arguments | 8.3 | Removed shortcut |
| Implicitly marking parameter … as nullable | 8.4 | Type $x = null without ?Type |
| Constant E_STRICT / CURLOPT_BINARYTRANSFER | 8.4 | Removed constants |
| Function mysqli_ping() is deprecated | 8.4 | Function scheduled for removal |
None of these stop the site today.
When a notice does become a problem
- It is printed into the page. If
WP_DEBUG_DISPLAYor the server'sdisplay_errorsis on, the notice is output before the HTML, or before a JSON response. AJAX and REST calls then fail: the block editor does not load, a form submits but shows nothing. This is the real damage deprecations do. - The log fills the disk. Each notice is written on every request. A busy site can write gigabytes in a week.
- It masks a real error. One fatal error among 10,000 deprecation lines is invisible.
What to do
- On a live site, in
wp-config.php:WP_DEBUGtrue,WP_DEBUG_LOGtrue,WP_DEBUG_DISPLAYfalse. Notices go to the log, never to the page. - Rotate or truncate the log. A cron job that empties
debug.logweekly, orWP_DEBUG_LOGset to a path the host rotates. - Group the log by plugin and update those plugins. Most notices disappear.
- For plugins that still produce notices after updating, check their last release date. Notices are a symptom; an unmaintained plugin is the problem.
Seeing all of it at once, before the next PHP upgrade
The log only shows code that ran. A scan reads every file. Upgravo checks all installed plugins and themes against the PHP version you choose and separates Breaks (fatal on that version) from Notices (deprecated, still runs), per plugin with file and line, so you know in advance which plugins will fill the log on PHP 8.4 or 8.5 and which will actually break.
Install it from WordPress.org: Upgravo – PHP Compatibility Check.
Sources
More guides
- "Deprecated: Creation of dynamic property" in WordPress – what it means and how to fix it
- "Implicitly marking parameter as nullable is deprecated" – PHP 8.4 and WordPress plugins
- "Uncaught TypeError: … must be of type …" – why PHP 8 turns old warnings into fatal errors
- "There has been a critical error on this website" after a PHP update
- PHP Compatibility Checker is abandoned – what to use instead
- My host forced a PHP upgrade and broke my WordPress site
- How to check if your WordPress plugins are compatible with PHP 8.3 or 8.4 before upgrading
- PHP 7.4 is end of life: what breaks in WordPress when you move to PHP 8