Force Admin Pages to use SSL

A simple edit of the wp-config.php file, in the root of the WordPress website, will force the access to the WordPress admin pages to be encrypted.

The entry to be added to the wp-config.php file is

define(‘FORCE_SSL_ADMIN’, true);

To make the change to the file either edit through your website hosting control panel or download the file using FTP and edit it locally, before returning it to the server.

If a general SSL certificate is in use on the server, it’s likely that you will need to add an exception within your browser as it won’t match your domain.

To be effective I found that I needed to add the line before the settings reference

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . ‘wp-settings.php’);

A simple one line addition to your WordPress wp-config.php file to improve the security of your website forcing the admin pages to be viewed with encryption.