Advertisement
Skip to content

WordPress SSL certificate error after changing web hosting

By Published 8 min read

On this page (6 sections)
  1. The short version
  2. DNS checks
  3. Certificate installation checks
  4. Redirect & URL checks
  5. Decision flow for the three checks
  6. Questions people still ask

In short: Check DNS first, certificate installation second, and redirects third. A moved WordPress site usually fails because the domain reaches the wrong server, the new server lacks a trusted certificate, or URL rules conflict.

Part of our guide on how to learn seo for beginners

A browser can report an SSL problem even when the certificate is fine. Your domain may still reach the old server.

At a glance
DNS checkCompare A and AAAA answers with the new host's documented addresses
Certificate checkRead the live certificate for hostname coverage and trusted issuance
Redirect checkRecord every status code and Location header in the chain
Mixed contentFind remaining http asset URLs after HTTPS loads
Private testUse a hosts-file entry before changing public DNS

The short version

  • Check the A and AAAA records against the new host's documented addresses.
  • Inspect the live certificate for its hostname, SAN entries, issuer, and validity dates.
  • Test redirects with curl and correct the server, CDN, WordPress, or plugin rule creating the wrong Location header.
  • A mixed-content warning appears after HTTPS works because page assets still use http URLs.
  • Use a second network to confirm the public result after making changes.

DNS checks

DNS chooses the server before WordPress, the web server, or its plugins can respond. Start here so later certificate tests examine the new host rather than an old route.

Find the new server's IPv4 and IPv6 addresses in the host dashboard or migration details. Use the exact addresses supplied for your account, because shared hosting and dedicated servers can differ. For the detail, see our notes on how to get office for a new computer.

DNS answers vary with TTL and resolver caching. Check live lookups from multiple networks instead of relying on one timing estimate.

  1. Find the new host's documented A and AAAA addresses. Mark this complete when you know which answers should appear.
  2. Run one lookup for the bare domain and one for www. On Windows, use nslookup example.com and nslookup www.example.com. On macOS or Linux, use dig +short example.com and dig +short www.example.com.
  3. Check IPv6 separately. On Windows, use nslookup -type=AAAA example.com. On macOS or Linux, use dig +short AAAA example.com.
  4. Compare every returned address with the new host's documented addresses. Matching answers send you to Certificate installation checks.
  5. If an answer points to the old host, update the A, AAAA, or CNAME record at the DNS provider. Remove an obsolete AAAA record if IPv6 sends visitors elsewhere.
  6. Ask someone to repeat the lookup over mobile data or another network. Different answers indicate resolver caching, so keep checking rather than changing WordPress.
  7. For a private test, add 203.0.113.25 example.com www.example.com to the hosts file. Replace the example address with your server address, then remove the entry after testing.

Certificate installation checks

Terminal window showing DNS lookups for a WordPress domain
Terminal window showing DNS lookups for a WordPress domain

Once DNS reaches the new host, inspect the certificate sent during a real HTTPS connection. A green control-panel status can miss a hostname mismatch or an old virtual-host configuration. If that sounds like your situation, read up on fix slow loading website next.

The command below uses OpenSSL, which is common on macOS and Linux. Windows users can run it in WSL or use the host panel and a browser certificate viewer instead. We go through core web vitals failing lcp after adding hero image step by step elsewhere on the site.

Replace example.com with the hostname you are testing. Run the command separately for the bare domain and www, because each name can select a different certificate.

  1. Run openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName. The -servername option tests the intended virtual host.
  2. Read Subject and the Subject Alternative Name list. The exact hostname must appear there. A certificate for example.com alone does not cover www.example.com.
  3. Read Issuer, Not Before, and Not After. The issuer should be trusted by normal browsers, and the current date must sit between the two validity dates.
  4. Run curl -vI https://example.com, then repeat it for https://www.example.com. Unix-like systems commonly include curl; Windows users can use built-in curl or inspect the browser's certificate details.
  5. If no certificate appears or the TLS handshake fails, select the hostname in the new host's SSL panel and install or issue a certificate there.
  6. If the issuer is unknown or self-signed, replace it with a certificate from the host or another trusted certificate provider. Do not use a self-signed certificate for public visitors.
  7. If SAN misses a hostname, request issuance again with every hostname visitors use. If Not After has passed, enable renewal or ask the host to renew it.
  8. If the fields are correct but the browser still warns, test both hostnames again. A different DNS answer, proxy, CDN, or cached route may still serve another certificate.
Certificate findings and the next action
What you seeWhat it meansFix
No certificate or handshake failureThe selected server has no usable TLS setupInstall or issue a certificate for that hostname
Self-signed or unknown issuerBrowsers cannot establish normal trustReissue through the host or a trusted certificate provider
SAN misses the bare domain or wwwOne hostname is uncoveredRequest a certificate containing every hostname visitors use
Not After is in the pastThe certificate has expiredEnable renewal or request a new certificate
Fields are correct but warning remainsAnother route or browser state may be involvedTest DNS, both hostnames, and the redirect chain again

Redirect & URL checks

A trusted certificate can still sit behind a broken redirect chain. The server, CDN, WordPress settings, and plugins can each write a different Location header. We go through free SSL hosting bundle step by step elsewhere on the site.

Test redirects only after DNS and certificate checks pass. Start with the requested HTTP and HTTPS URLs, then follow the hostname and protocol changes shown in the response. It helps to understand fix delayed license email delivery before going further.

  1. Run curl -IL https://example.com and curl -IL http://example.com. On Windows, use built-in curl or inspect the browser's network panel if curl is unavailable.
  2. Record every status code and Location header. A normal result ends at the intended HTTPS URL with a successful response; repeated changes between HTTP and HTTPS show a loop.
  3. If the web server changes HTTPS to HTTP before WordPress responds, inspect Apache, Nginx, the CDN, and control-panel force-SSL settings. Remove duplicate force-HTTPS rules.
  4. If the response reaches WordPress before the wrong redirect appears, check Settings, General. WordPress Address and Site Address should use the final HTTPS hostname.
  5. If the dashboard is unavailable, add define('WP_HOME', 'https://example.com'); and define('WP_SITEURL', 'https://example.com'); above the stop-editing comment in wp-config.php.
  6. Temporarily rename wp-content/plugins to wp-content/plugins.off through SFTP or SSH. If the loop stops, restore the folder and enable plugins individually until the cause returns.
  7. Back up the database before changing stored URLs. With WP-CLI, run wp search-replace 'http://example.com' 'https://example.com' –all-tables –skip-columns=guid –dry-run, review the count, then repeat without –dry-run if correct.
  8. After redirects work, inspect mixed content in browser developer tools. Replace remaining internal http asset URLs in themes, widgets, page builders, and CDN settings, then clear caches.

Decision flow for the three checks

Certificate details beside a terminal showing an OpenSSL command
Certificate details beside a terminal showing an OpenSSL command

Follow the layers in order and stop when a check fails. If DNS does not match the new host, fix DNS before testing the certificate.

If DNS matches, inspect the certificate for each hostname. If the issuer, SAN, or dates fail, install or reissue the certificate before changing redirects. We go through fixing missing site properties step by step elsewhere on the site.

If the certificate is valid, run the HTTP and HTTPS redirect tests. Fix the layer writing the wrong Location header, then test again.

If redirects finish at the correct HTTPS URL, check mixed content in the browser console. Clean old asset URLs only after the public route works.

  1. DNS matches the new host: continue to certificate checks.
  2. Certificate covers each hostname and has trusted, current dates: continue to redirect checks.
  3. Redirects end at the intended HTTPS URL: inspect mixed content.
  4. Any failed layer: fix that layer and repeat its test before moving on.
  5. Final remote test passes: remove any hosts-file override and clear relevant caches.

Questions people still ask

How long should I wait before worrying about the SSL error?

Measure the result with nslookup or dig from more than one network. DNS answers depend on TTL and resolver caching. If the new address appears everywhere, move to certificate checks instead of waiting.

Do I need to buy a new SSL certificate after moving hosts?

Not always. Install the old certificate only if you have its matching private key, intermediate chain, and renewal access. Reissuing on the new host is often simpler.

Why does my site say 'not fully secure' even with a padlock?

The certificate works, but the page still requests assets over http. Use the browser console to identify each URL, then update internal links, theme settings, widgets, and third-party settings.

Can I test the new host before changing DNS?

Yes. Add the new server address and domain to your computer's hosts file. Test the certificate and redirects, then remove the entry before checking public DNS.

How do I tell whether a redirect loop comes from WordPress?

Run curl -IL and inspect each Location header. A web-server or CDN response points to that layer. A redirect generated after WordPress loads points to site URLs or a plugin.

After a migration, I check DNS before touching WordPress. The returned address often explains why a certificate appears broken.