Move your WordPress site to HTTPS correctly.
Moving WordPress to HTTPS involves more than installing a certificate. The database contains hardcoded URLs, plugins can cause mixed content, and configuration must be adapted.
A poorly executed migration can break the site, cause redirect loops, or leave mixed content that scares visitors.
This guide covers all steps for a successful WordPress HTTPS migration.
Why WordPress needs special attention:
Why migrate your WordPress:
Complete process for WordPress HTTPS:
Necessary modifications:
// wp-config.php - Force HTTPS
define("FORCE_SSL_ADMIN", true);
if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && $_SERVER["HTTP_X_FORWARDED_PROTO"] === "https") {
$_SERVER["HTTPS"] = "on";
}
// .htaccess - HTTP to HTTPS redirect
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
// WP-CLI - Search & Replace
wp search-replace "http://example.com" "https://example.com" --all-tables
FORCE_SSL_ADMIN secures the dashboard. X-Forwarded-Proto handles proxies/CDN.
Tips for smooth migration:
Really Simple SSL is popular, but manual configuration is cleaner.
Add the X-Forwarded-Proto code in wp-config.php if you're behind a proxy.
Look for hardcoded URLs in theme files and fix them.
Browser console (F12) or use whynopadlock.com.
Yes, regenerate the sitemap with new HTTPS URLs.
Add the HTTPS version of your site as a new property.
A well-executed WordPress HTTPS migration improves security, SEO and visitor trust.
Monitor your SSL certificate with MoniTao to be alerted before any expiration.
Start free, no credit card required.