Disable and Block external URLS in WordPress.

Place the following code in the wp-config.php file.

define('WP_HTTP_BLOCK_EXTERNAL', true);