WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.

It may happen that you receive the following warning in your WordPress admin pages or your web server’s error log:

Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /srv/www/wordpress/wp-includes/update.php on line 131

Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /srv/www/wordpress/wp-includes/update.php on line 323

Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /srv/www/wordpress/wp-includes/update.php on line 501

This error means that WordPress was unable to contact the server api.wordpress.org to check for WordPress updates.

The error may have several causes and solutions:

  • If you have shell access to your web server, log in and try contacting api.wordpress.org yourself, to see what the specific problem is. It may be that the site is down. For example:

    curl https://api.wordpress.org/

    If you don’t see any errors, then the site is up and working properly.

    If you do see an error, read the text of the error message and search for it to find possible solutions.

    You may also attempt to connect from another site, or use a service such as downdetector.com to determine if the WordPress server is down.

  • On systems which use SELinux, the web server may be denied permission to make outgoing network connections. You can find evidence of this in /var/log/audit/audit.log. For example:

    type=AVC msg=audit(1531585576.912:201): avc: denied { name_connect } for pid=802 comm="php-fpm" dest=443 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:http_port_t:s0 tclass=tcp_socket permissive=0

    To resolve the problem, set the SELinux boolean which allows the web server to make outgoing network connections, httpd_can_network_connect.

    setsebool -P httpd_can_network_connect 1

    Now SELinux will permit WordPress to make outgoing network connections to check for updates.

    For further information on resolving SELinux problems, see the Red Hat Enterprise Linux SELinux documentation.

If you don’t want WordPress to check for updates automatically, you can disable this by editing your wp-config.php and adding the following line, above the line that reads /* That's all, stop editing! Happy blogging. */:

define( 'WP_AUTO_UPDATE_CORE', false );

Now WordPress will no longer check for or install updates.

Leave a Comment

Your email address will not be published. Required fields are marked *