WordPress shows a deprecation notice about Requests_ class names
Your error
Deprecated: The PSR-0 `Requests_...` class names in the Requests library are deprecated. Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.2 more lines it can showFix it fast
Most common cause, 1 of 3Plugin or theme code still names Requests_ classes
If a third-party plugin is the source, update it, or ask its author for a release that uses the new names.
wp plugin update my-plugin
# own code, before: catch ( Requests_Exception $e )
# own code, after: catch ( WpOrg\Requests\Exception $e )Short answer
The notice that PSR-0 `Requests_...` class names are deprecated appears on WordPress 6.2 to 7.1 when a plugin or theme still calls old Requests_ classes or includes wp-includes/class-requests.php. Update that plugin, or rename its calls to the WpOrg\Requests namespace. On a live site, send notices to debug.log with WP_DEBUG_LOG and turn WP_DEBUG_DISPLAY off.
Which cause do you have?
Search the plugins, themes and must-use plugins for the old class names and for the deprecated file. Hits on Requests_ names mean cause 1; a hit on class-requests.php means cause 2. Run it from the WordPress root.
grep -rnE "Requests_[A-Z][A-Za-z_]*|class-requests\.php" wp-content/plugins wp-content/themes wp-content/mu-pluginsThen find the line you see in this list and open its fix:
- 1Plugin or theme code still names Requests_ classes
grep prints lines such as catch ( Requests_Exception $e ) or new Requests_Response inside one plugin folder - 2Code requires the old wp-includes/class-requests.php file
grep finds require or include with class-requests.php, and the notice fires on every request, even pages that make no HTTP call - 3Debug output is switched on for the live site
The notice prints at the top of pages or inside admin screens, and wp-config.php sets WP_DEBUG to true
What does the error look like?
Deprecated: The PSR-0 `Requests_...` class names in the Requests library are deprecated. Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.wp-includes/class-requests.phpwp-includes/Requests/src/Autoload.php
Cause 1 of 3
Plugin or theme code still names Requests_ classes
You seegrep prints lines such as catch ( Requests_Exception $e ) or new Requests_Response inside one plugin folder
Check
WordPress 6.2 moved the bundled Requests library to version 2, which puts every class in the WpOrg\Requests namespace. Old names like Requests_Exception still work through an alias, but the core autoloader raises the PSR-0 deprecation notice the first time one is used.
grep -rln "Requests_" wp-content/plugins wp-content/themes | cut -d/ -f1-3 | sort -uFix
If a third-party plugin is the source, update it, or ask its author for a release that uses the new names. In code you own, swap each old name for its namespaced class, for example Requests_Exception becomes WpOrg\Requests\Exception.
wp plugin update my-plugin
# own code, before: catch ( Requests_Exception $e )
# own code, after: catch ( WpOrg\Requests\Exception $e )Verify
Load the page that showed the notice. No new deprecation line is added to wp-content/debug.log.
tail -n 20 wp-content/debug.logConfirmed by make.wordpress.org
Cause 2 of 3
Code requires the old wp-includes/class-requests.php file
You seegrep finds require or include with class-requests.php, and the notice fires on every request, even pages that make no HTTP call
Check
Since 6.2, wp-includes/class-requests.php is a deprecated shim. Its first lines trigger the same E_USER_DEPRECATED notice as soon as the file is loaded, before any class is used.
grep -rn "class-requests.php" wp-content/Fix
Delete the include. WordPress core loads the library itself: class-wp-http.php requires Requests/src/Autoload.php and registers it when WpOrg\Requests\Autoload is not yet defined. Code that runs earlier can use that same guarded block.
if ( ! class_exists( 'WpOrg\Requests\Autoload' ) ) {
require ABSPATH . WPINC . '/Requests/src/Autoload.php';
WpOrg\Requests\Autoload::register();
}Verify
The grep for class-requests.php returns nothing and the notice is gone from new page loads.
grep -rn "class-requests.php" wp-content/ || echo cleanConfirmed by raw.githubusercontent.com
Cause 3 of 3
Debug output is switched on for the live site
You seeThe notice prints at the top of pages or inside admin screens, and wp-config.php sets WP_DEBUG to true
Check
Deprecation notices only reach the browser when WP_DEBUG is true and WP_DEBUG_DISPLAY keeps its default of true. The old names keep working through the alias, yet visitors should never see the message.
grep -nE "WP_DEBUG|display_errors|REQUESTS_SILENCE" wp-config.phpFix
Write notices to a log file and hide them from pages. While you wait for a plugin update, wp-config.php can also define REQUESTS_SILENCE_PSR0_DEPRECATIONS as true; it must exist before the first old class is requested.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
// stopgap until the plugin is updated
define( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS', true );Verify
Pages render with no notice text, and real errors still land in wp-content/debug.log.
ls -l wp-content/debug.logConfirmed by developer.wordpress.org
How do I stop it coming back?
- Run a staging copy with WP_DEBUG_LOG on after each core or plugin update, and scan debug.log for new deprecation lines.
- In custom plugins, call the Requests library only through WpOrg\Requests names and never include files from wp-includes by path.
- Remove the REQUESTS_SILENCE_PSR0_DEPRECATIONS line once the plugin that needed it ships a fixed release.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: Spotless Laundry, EZ Estimater.