Installing the SSL certificate is step one. WordPress doesn’t notice. It will keep serving HTTP, keep emitting HTTP-prefixed asset URLs, and keep accepting logins over plaintext. The push to HTTPS-only takes another four small changes, and the order matters.
What’s happening
cPanel via AutoSSL or Let’s Encrypt drops the certificate at /var/cpanel/ssl/installed/certs/ and binds it to the domain in Apache or LiteSpeed. The web server now serves HTTPS, but WordPress’s siteurl and home options still say http:// until you change them. Asset URLs stored in the database (post content, theme settings, plugin configs) also still say http://. The redirect at the web server level rewrites the URL, but mixed content warnings come from those stored URLs.
How to verify
wp option get siteurl
wp option get home
curl -I http://example.com
curl -I https://example.com
siteurl and home should both start with https://. The HTTP curl -I should return a 301 redirect to HTTPS. The HTTPS curl -I should return 200.
The fix
-
Update
siteurlandhome:wp option update siteurl https://example.com wp option update home https://example.com -
Search-replace HTTP-prefixed URLs in the database. Use
--dry-runfirst to see scope:wp search-replace 'http://example.com' 'https://example.com' --all-tables --skip-columns=guid --dry-run wp search-replace 'http://example.com' 'https://example.com' --all-tables --skip-columns=guidSkip
guidbecause it’s a permanent identifier — changing it breaks feed consumers. -
Add the HTTPS redirect to
.htaccessso any direct HTTP request gets redirected at the web server, not at WordPress. Place above the# BEGIN WordPressblock:RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]On LiteSpeed, the same
.htaccessworks. If the site is behind Cloudflare or another proxy that terminates TLS, also add awp-config.phpblock:if ( ! empty( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ) { $_SERVER['HTTPS'] = 'on'; } -
Force the admin to HTTPS at the WordPress level:
define( 'FORCE_SSL_ADMIN', true ); -
Audit mixed content. Browse the homepage, a content-heavy article, and the checkout if e-commerce. Open the browser’s console and look for blocked or warning resources. Common culprits: hardcoded
<img src="http://...">in widgets, CSSurl()references to HTTP assets, JavaScript that hardcodes the protocol. -
Once stable, add HSTS. Start with a short max-age while you confirm nothing breaks, then move to long:
Header always set Strict-Transport-Security "max-age=300; includeSubDomains" env=HTTPSAfter a week of clean operation:
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS -
Submit to the HSTS preload list (
hstspreload.org) only after the long max-age has been live for a week and you’re confident every subdomain is HTTPS-clean. Preload is a one-way decision — reversing it takes months.
Stack Harbor handles this kind of transition as part of enterprise WordPress work.