Block External Requests in WordPress
If you want to block WordPress from accessing the internet, you can add the following constant to your wp-config.php:
define('WP_HTTP_BLOCK_EXTERNAL', true);
If you want to whitelist one or more domains, you can do so by adding this line to your wp-config.php:
define( 'WP_ACCESSIBLE_HOSTS', 'example.com, *.example.com' );