“Constant E_STRICT is deprecated” in WordPress: what it means on PHP 8.4

By CompatNav · Published · Last reviewed · 2 min read

Short answer

It’s a deprecation notice from PHP 8.4 and later: a plugin or theme still mentions E_STRICT, an error level PHP removed years ago. The code keeps working. It usually sits in a line that sets which errors to report, often in debugging or framework code bundled with a plugin. Update the plugin, or send the message to its developer: the fix is to delete E_STRICT from that line.

The message, exactly

A debugging helper sets which PHP errors to report, and still names E_STRICT. PHP 8.3 runs it silently; PHP 8.4 adds the notice:

wp-content/plugins/debug-helper/debug-helper.php

<?php
error_reporting(E_ALL & ~E_STRICT);
echo "Error level set\n";

Output on PHP 8.3.35

Error level set

Output on PHP 8.4.26

Deprecated: Constant E_STRICT is deprecated in /var/www/html/wp-content/plugins/debug-helper/debug-helper.php on line 2
Error level set

php.net, in the PHP 8.4 deprecations: “Because the E_STRICT error level was removed, this constant is now deprecated.” (php.net)

Why it appears

E_STRICT was once a separate level of PHP messages about coding style. PHP folded those messages into other levels long ago, so the level no longer exists; PHP 8.4 now also marks the name. Code that still lists it, usually in an error_reporting() line, gets the notice. You’ll often find it in older frameworks or libraries that a plugin bundles in a vendor/ or lib/ folder.

Is it urgent?

No. The output above is the same on both versions. It needs fixing at some point, because a future PHP version is expected to remove the constant, and a plugin that loads the line on every request writes the notice on every request.

Who fixes it

  1. Find the plugin or theme: the folder after wp-content/plugins/ or wp-content/themes/ in the message.
  2. Update it (Dashboard → Updates).
  3. Already on the latest version? Send the full message to its developer.
  4. Meanwhile, keep notices off your pages: the WordPress debug log shows how.

A check that reads code finds it while your site still runs PHP 8.3; CompatNav reports it as a deprecation notice with the file and line. The other PHP 8.4 changes are in WordPress and PHP 8.4.

Key takeaways

  • It’s a deprecation notice from PHP 8.4 and later; the code keeps working.
  • E_STRICT names an error level PHP no longer has, so the constant itself is now deprecated.
  • It usually appears in a line that sets error_reporting(), often in bundled library or debugging code.
  • The fix is to remove E_STRICT from that line; nothing else changes.
  • A check that reads code finds it before you upgrade.

Frequently asked questions

Is “Constant E_STRICT is deprecated” dangerous?

No. The code runs as before; PHP only adds the notice. It should still be fixed, because a future PHP version is expected to remove the constant.

Why do Elementor or other big plugins show it?

Any plugin, theme or bundled library that still names E_STRICT shows it on PHP 8.4 and later. Update to the latest version: maintained plugins remove it quickly.

Can I hide it?

Log notices instead of displaying them, as in our guide to the WordPress debug log. Hiding doesn’t fix it; updating does.

Check your own site before you upgrade

CompatNav is a free WordPress plugin. It reads the code of your plugins and themes on your own server and tells you, in plain words, what will break and what will only show notices on the PHP version you choose. It never changes your code. It can’t see problems that only appear while code runs with real data, so a quick check of your site after the upgrade still matters.

Get CompatNav on wordpress.org How it works

Sources

About the code examples: each output is the real output of the code shown, run with the official PHP builds, without a php.ini, with all errors reported and displayed. Only the file path was replaced by a neutral server path.