Configure WordPress to Use Proxy

If you setup a WordPress site on a server in intranet behind a proxy, you might get following error when you search plugins and themes in admin console.

An Unexpected HTTP Error occured during the API request.

This is because WordPress does not know the proxy server to talk to external internet. To resolve this, simply enable proxy by adding following lines to wp-config.php file

define(‘WP_PROXY_HOST’, ‘’);
define(‘WP_PROXY_PORT’, ’80’);

Replace and 80 with your actual proxy server and port.

If the intranet proxy requires user authentication, appending following lines.

define(‘WP_PROXY_USERNAME’, ‘UserName_ReplaceMe’);
define(‘WP_PROXY_PASSWORD’, ‘UserPassword_ReplaceMe’);


9 responses to “Configure WordPress to Use Proxy”

Leave a Reply