WordPress is a great and very popular website building tool, and Cloudflare is a great way to get HTTPS on your website for free. Thanks to Cloudflare’s Flexible SSL system, you don’t even need to manage SSL certificates to use it!
However, getting WordPress to show a padlock and make all pages work can be a bit tricky. This article explains a good way to configure your website correctly with Cloudflare Flexible SSL.
Heads up! Instead of making WordPress work with Flexible SSL, you can also configure you website with Full SSL on Cloudflare instead! Using Full SSL is more secure, easier to setup on the WordPress site and quite easy to setup on the hosting side too. See this article on how to set it up: How to setup Full SSL with Cloudflare
If you’ve already attempted to make WordPress available on HTTPS yourself, you may have locked yourself out of your WordPress admin area. If so, you should probably see errors like this when trying to access it:
- Google Chrome (and derivatives):
- Mozilla Firefox: This page isn’t redirecting properly
To regain access to your WordPress admin area, you can do the following:
- Login to your client area, find your hosting account, click Manage and then go click Control Panel.
- Go to phpMyAdmin, find your WordPress database and click Connect Now.
- Find the table with the name ending with
_optionsand click on the name.
- Find the rows with the column
home. These should be the first two in the list, but you can use the Search function if you can’t find them.
- Double click the value in the
option_valuecolumn, and change the start of the URL from
If you have multiple databases and you don’t know which database corresponds to your WordPress website, you can find your database in the installation details in Softaculous, or by checking the
wp-config.php of your WordPress installation.
With this option changed, you should be able to login to the WordPress admin area again.
If you’ve just enabled Cloudflare, all the Cloudflare settings should be standard, which is good.
If you’ve already tinkered with the Cloudflare settings before trying to get HTTPS to work, here are some settings to verify:
- In the SSL/TLS → Overview tab, Encryption Mode is set to “Flexible”.
- In the SSL/TLS → Edge Certificates tab, the setting “Always Use HTTPS” is set to Off.
- In the SSL/TLS → Edge Certificates tab, the setting “Automatic HTTPS Rewrites” is set to Off.
The easiest way to get Flexible SSL to work properly is with the - aptly called - Really Simple SSL plugin. You can install the plugin by hand or automatically through the WordPress admin area.
From there, making HTTPS work is as simple as hitting the enable button to make HTTPS work for both your front website and WordPress admin area!
After enabling the plugin, you can also enable the
.htaccess in Really Simple SSL, enable Always Use HTTPS in Cloudflare, or both, to enforce HTTPS on all pages.