How to enable HTTPS in WordPress
HTTPS encrypts the connection between visitor and site and removes the Not secure label in the browser. Move WordPress to HTTPS as soon as the domain has an SSL certificate. Here is how to do it cleanly, without crutch plugins or losing traffic.
Check your site
-
Confirm the certificate is active
In cPanel open SSL/TLS Status and check that the domain shows a green lock. If there is no certificate, issue one with AutoSSL first, otherwise the site will load with an error.
-
Change the site URLs to https
In WordPress open Settings > General and replace http with https in both WordPress Address (URL) and Site Address (URL). After saving you will be redirected and may need to log in again.
-
Set the URLs in wp-config.php if needed
If the URL fields are greyed out, they are defined in code. Open wp-config.php and put the https address into define('WP_HOME', ...) and define('WP_SITEURL', ...).
-
Update old links in the database
Posts, images, and menus may still hold hard-coded http links. Run a replace with the Better Search Replace plugin or WP-CLI search-replace, changing http://your-domain to https://your-domain.
-
Turn on redirection to https
So visitors on old http links reach the secure version, add a 301 redirect in .htaccess. On LiteSpeed this works without extra plugins.
-
Clear the cache
Purge the page cache in your caching plugin and in LiteSpeed Cache, plus your browser cache. Otherwise you will see the old http version and think nothing worked.
How to verify the result
Open the site in a private window: the address should show https and a padlock with no warnings. You can confirm the certificate and chain in seconds with the free TechGuard SSL checker.
Tip: Do not leave the http address in Settings > General after the certificate is installed: it is the most common cause of endless redirects and a white screen.
Related guides
Found problems?
Slow hosting, SSL trouble or frequent downtime? Move to TomisHost: fast hosting with free SSL, daily backups and free migration help.
TomisHost hosting