Home / Fix guides / Website not using HTTPS / WordPress

WordPress fix guide

How to move your WordPress site from HTTP to HTTPS

If browsers show "Not secure" next to your address, your WordPress site is still served over plain HTTP. The fix has four parts: a certificate, the right site URLs, a redirect and a cleanup of old http:// links.

HTTPS encrypts the connection between your visitors and your site. WordPress does not create the certificate itself, so the work is split between your host (the certificate) and WordPress (the URLs and content). This guide covers both, in a safe order.

What you need before you start

  • Admin access to WordPress and to your hosting account (or a host who can help).
  • A fresh backup of your files and database. Most hosts offer one-click backups, or use a backup plugin such as UpdraftPlus.
  • Ten to thirty minutes, and ideally a quiet time of day for your site.

The order matters. If you change the WordPress URLs to https:// before a working certificate exists, you can lock yourself out of the dashboard.

Step by step

  1. Back up the site. Files and database, and check you can download or restore the backup.
  1. Get a certificate from your host. Most WordPress hosts include free certificates (often Let's Encrypt). Look in your hosting panel (cPanel, Plesk or your host's own dashboard) for "SSL/TLS", "Let's Encrypt" or "AutoSSL". Install or enable it for your domain, including the www version. Then open https://yourdomain.com in a browser. If you see your site with a padlock, the certificate works. If you get a warning, stop here and ask your host. Certificates usually can only be issued once your domain's DNS points at the host.
  1. Update the WordPress and Site Address. In the dashboard go to Settings > General and change both WordPress Address (URL) and Site Address (URL) to start with https://. Save. You will be logged out and will log in again on the https:// address. Recent WordPress versions also have a one-click "Update your site to use HTTPS" prompt under Tools > Site Health, which does a similar job when it appears.

If those fields are greyed out, the values are set in wp-config.php and you must edit them there:

define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');
  1. Redirect HTTP to HTTPS. Visitors and search engines still have old http:// links, so those must forward to the secure version. Easiest options, in order:
  • A "Force HTTPS" toggle in your host's panel.
  • The plugin Really Simple SSL, which detects the certificate and sets up the redirect.
  • A manual rule. On Apache hosting, add this to the .htaccess file in your WordPress folder, above the # BEGIN WordPress line:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
</IfModule>

On Nginx the redirect lives in the server config, so ask your host. Use only one method, not several at once.

  1. Fix mixed content. Old posts, images and widgets often still contain http://yourdomain.com/... links, which makes the padlock disappear or show a warning. Replace them in the database with Better Search Replace, or with WP-CLI if you have shell access:
wp search-replace 'http://example.com' 'https://example.com' --dry-run

Check the dry run output, then run it again without --dry-run. These tools handle serialized data correctly, which a plain SQL find and replace does not, so avoid the latter. Page builders may store URLs separately (Elementor has a Replace URL tool under Elementor > Tools). Also check hard coded links in your theme's header, footer and Appearance > Customize.

  1. Clear every cache. Clear your caching plugin, host cache and CDN cache, otherwise old http:// pages keep being served.
  1. Test. Visit several pages in a private window. Look for the padlock. If it is missing, open the browser developer tools (F12), then the Console tab, and look for "mixed content" messages naming the exact file.

After the switch

  • Add the https:// version of your site as a property in Google Search Console and resubmit your sitemap.
  • Update the site address in Google Analytics and any other service that stores your URL.
  • If you use Cloudflare or another proxy, set its SSL mode to full (strict) so it validates your certificate.
  • Once everything works for a few days, consider adding an HSTS header, which tells browsers to always use HTTPS. See the HSTS guide for WordPress. Do not enable it before HTTPS works everywhere, because it is hard to undo quickly.

If something goes wrong

  • "Too many redirects" loop: often caused by a proxy or CDN that talks to your server over HTTP. Remove duplicate redirect rules first, then check the SSL mode at your CDN or ask your host about the X-Forwarded-Proto setting.
  • Locked out of the dashboard: set WP_HOME and WP_SITEURL in wp-config.php back to http:// until the certificate is fixed.
  • Certificate warning on the www version: the certificate must cover both example.com and www.example.com.

Checking it stays fixed

Certificates expire and renewals can fail silently. Week 10 of SiteMonday (domain, SSL and email deliverability) checks your certificate and reports problems in a ranked fix list, see week 10. For the general, non WordPress version of this problem, read the HTTPS guide.

Not on WordPress? Read the general guide to website not using https, or the guide for Cloudflare, Nginx, Apache, cPanel, GoDaddy, SiteGround.

Questions

Does WordPress give me an SSL certificate?

No. WordPress core does not issue certificates. Your hosting provider does, and WordPress then only needs its URLs set to https://.

Do I need a plugin to use HTTPS on WordPress?

No. You can change the URLs in Settings > General, add a redirect in your host panel or .htaccess, and fix links yourself. A plugin such as Really Simple SSL just automates those steps.

Why does my site still show "Not secure" after installing the certificate?

Usually mixed content: images, scripts or stylesheets still load from http:// addresses. Search and replace the old URLs and check the browser console to find the remaining ones.

Will moving to HTTPS hurt my Google rankings?

A correct move with 301 redirects should not. Keep the redirects in place, update your sitemap and add the https:// property in Search Console.

The Site Address fields in Settings > General are greyed out. What now?

The URLs are defined in wp-config.php as WP_HOME and WP_SITEURL. Edit them there, using a file manager or SFTP, and take a backup first.

More WordPress fixes