New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

SSL

How to fix WordPress SSL certificate errors

Padlock warnings usually come from expired certificates, wrong DNS, or WordPress still serving http assets. This tutorial covers host certificates, WordPress URL settings, redirects, and mixed content without breaking login cookies.

Time: 30-60 minutes Level: Intermediate

Types of SSL problems on WordPress

  • Expired or missing certificate on the server
  • Certificate issued for www but visitors use apex, or the reverse
  • Cloudflare or CDN SSL mode mismatch with origin host
  • WordPress siteurl/home still set to http://
  • Mixed content: images, CSS, or scripts loaded over http on an https page

Step 1: Verify the certificate at the host

Log into hosting and open SSL/TLS or Let’s Encrypt. Confirm a valid certificate exists for every hostname you use publicly. Test both https://example.com and https://www.example.com in a private browser window.

If you use Cloudflare, check SSL/TLS overview. Flexible mode between visitor and Cloudflare but http to origin often causes redirect loops once WordPress forces HTTPS. Full or Full (strict) is usually correct when origin has a valid cert.

Step 2: Set WordPress to HTTPS

In wp-admin go to Settings → General. Set both WordPress Address and Site Address to https://. If admin will not load, set URLs in wp-config.php instead:

php
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );

Replace example.com with your live domain. Use the canonical hostname you want in Google Search Console, usually apex or www, not both without redirects.

Step 3: Force HTTPS in .htaccess (Apache)

On Apache hosts, add this above the WordPress rewrite block in .htaccess in the site root. Back up the file first.

apache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

Nginx users need a server block change from the host or a managed redirect rule. Do not paste Apache rules into nginx.

Step 4: Fix mixed content

Open browser DevTools → Console on an https page. Mixed content warnings list http URLs for images, scripts, or CSS. Common fixes:

  • Run a search-replace on the database from http to https for your domain only, with a backup first.
  • Re-save permalinks under Settings → Permalinks.
  • Clear page cache and CDN cache after URL changes.
  • Update hardcoded http links in widgets, page builders, or theme customiser fields.

Use WP-CLI search-replace on staging when possible:

bash
wp search-replace 'http://example.com' 'https://example.com' --all-tables --dry-run
wp search-replace 'http://example.com' 'https://example.com' --all-tables

Step 5: Test login and checkout

After SSL changes, log out and log in again. WooCommerce checkout and contact forms should submit over https without browser warnings. Cookie issues often mean WordPress URL and redirect rules disagree.

Never edit live databases without a backup. A bad search-replace can break serialized widget data. Dry-run first or use a dedicated migration tool.

FAQs

Why does SSL work in admin but not the front end?

Mixed content or a cache layer serving old http HTML. Clear caches and fix hardcoded http asset URLs in content or theme files.

Do I need an SSL plugin?

Plugins can help mixed content on legacy sites, but correct certificates and URLs at the host are the real fix. Plugins do not replace an expired cert.

How do I fix NET::ERR_CERT_DATE_INVALID?

The certificate expired or the server clock is wrong. Renew via Let’s Encrypt or your host, then confirm auto-renewal is enabled.

Can BugShield fix SSL for me?

Yes. SSL and DNS mismatches are common emergency fixes. You get a confirmed quote and a developer who verifies HTTPS end to end.

Rather someone else fixed it?

Request a fix at a confirmed price. Named UK developer, secure Vault, direct chat.

Request a Fix