Hosting & Migration 5 min read

Setting up SSL and forcing HTTPS on WordPress

How to set up SSL and force HTTPS on WordPress: free certificates, updating site URLs, redirects, fixing mixed content, Cloudflare SSL modes, HSTS and SEO checks.

Usman Muhammad UsmanUpdated October 13, 2026
Setting up SSL and forcing HTTPS on WordPress

SSL certificates encrypt the connection between visitors and your website, shown by https and a padlock in the browser. HTTPS is essential for security, trust and SEO, and browsers warn visitors about sites without it. Most hosts now provide free certificates, but switching a WordPress site to HTTPS still needs a few careful steps.

Why HTTPS matters

HTTPS encrypts data such as login details, form submissions and payment information, protecting it from being intercepted. Browsers mark http pages as not secure, which damages trust and conversions, especially on pages with forms.

Google uses HTTPS as a ranking signal, and many modern browser features require it. There is no good reason for a business site to run without HTTPS today.

Getting a certificate

Most hosts provide free certificates through Let’s Encrypt or their own systems, issued and renewed automatically. In cPanel, check SSL/TLS Status or AutoSSL. Managed WordPress hosts usually enable SSL with one click.

Paid certificates with organisation or extended validation are available but rarely necessary for small businesses. Free certificates provide the same encryption. See cPanel basics.

Switching to HTTPS
  1. 1Get certificateFree from host
  2. 2Update URLsSettings > General
  3. 3Force redirect301 to https
  4. 4Fix mixed contentSearch and replace
  5. 5Update toolsSearch Console, profiles

Update WordPress URLs

In Settings > General, change the WordPress Address and Site Address from http to https. Save, and you will be logged out and need to log in again on the https version. If the setting is locked, the URLs may be defined in wp-config.php.

Take a backup before changing these settings. A wrong value can make the admin area inaccessible, which can be fixed by editing wp-config.php or the database.

Redirect http to https

Add a server-level redirect so every http request goes to https with a 301 redirect. Many hosts offer a ‘Force HTTPS’ toggle. On Apache, rules can be added to .htaccess; on Nginx, in the server configuration.

Make sure the redirect goes directly to your preferred version, with or without www, in a single step to avoid chains. See 301 redirects explained.

Fix mixed content

Mixed content occurs when an https page loads images, scripts or stylesheets over http. Browsers may block these resources or show warnings. It often comes from old URLs in post content, theme settings, widgets or custom CSS.

Run a search and replace on the database to change http://yourdomain.com to https://yourdomain.com, using a tool such as Better Search Replace or WP-CLI, which handles serialised data. Check theme and page builder settings for hard-coded URLs.

Check third-party resources

Embedded content from other sites, such as fonts, scripts or images loaded from http URLs, also causes mixed content. Update embeds to use https versions, which almost all services support.

Browser DevTools’ console lists mixed content warnings with the exact resource URLs, making them easy to find.

Cloudflare SSL modes

If you use Cloudflare, choose the right SSL mode. Full (strict) encrypts traffic between visitors and Cloudflare and between Cloudflare and your server, with a valid certificate on the server. It is the recommended setting.

Flexible mode encrypts only between visitors and Cloudflare and can cause redirect loops with WordPress. Avoid it if your host supports SSL. See setting up Cloudflare.

HSTS

HTTP Strict Transport Security tells browsers to always use HTTPS for your domain, even if someone types http. It prevents some attacks and saves a redirect. It is set with a response header by your host, CDN or a security plugin.

Enable HSTS only after HTTPS works perfectly across the site and subdomains, because browsers will refuse to load the site over http for the duration you set. See HTTP security headers.

Update Search Console and analytics

If you use a URL-prefix property in Search Console, add the https version. A domain property covers both automatically. Update the default URL in Google Analytics and links in your Google Business Profile, social profiles and email signatures.

Submit the https sitemap in Search Console. Google usually handles the switch smoothly when redirects are in place.

Certificate renewal

Free certificates usually last around 90 days and renew automatically. Monitor renewals, as failures cause security warnings for every visitor. Uptime monitoring services can alert you when a certificate is about to expire.

Renewal failures are often caused by DNS changes, firewall rules or Cloudflare settings blocking validation. See fixing SSL certificate errors.

WooCommerce and HTTPS

Online stores must use HTTPS everywhere, not only on checkout. Payment gateways require it, and customers expect it. After switching, test the full purchase flow, including payment and confirmation emails.

Check that order emails and account pages use https links. See WooCommerce security basics.

Testing

After the switch, test pages with an SSL checker to confirm the certificate is valid and the chain is complete. Crawl the site to find any internal links or resources still using http. Check forms, logins and checkouts.

Look at the padlock in several browsers and on mobile. A broken padlock or warning indicates remaining mixed content.

Getting help

SSL setup and HTTPS migration are part of my hosting and migration service and included in every WordPress build.

For other security improvements, see my WordPress security hardening checklist.

Key takeaways

  • Free SSL certificates from your host are enough for most businesses.
  • Update WordPress URLs and force a single 301 redirect to https.
  • Fix mixed content with a database search and replace.
  • Use Cloudflare Full (strict), not Flexible, with WordPress.

Frequently asked questions

Is SSL free?

Most hosts provide free certificates through Let's Encrypt or similar services.

Will switching to HTTPS affect SEO?

Done with proper redirects, it is positive or neutral.

Why does my site show 'not secure' after installing SSL?

Usually mixed content: some resources still load over http.

What causes too many redirects after enabling HTTPS?

Often Cloudflare Flexible SSL or conflicting redirect rules.

Do I need SSL if I do not sell online?

Yes. Browsers warn visitors and forms need encryption.

How often do certificates renew?

Free certificates usually renew automatically every few months.

Do subdomains need their own certificate?

Each subdomain needs to be covered, either by its own certificate or a wildcard certificate. Most hosts issue certificates for subdomains automatically when they are added.

Free website audit

Get a free audit of your website

Tell me your URL and I'll send a short, prioritized list of the speed, SEO and security fixes that will make the biggest difference.

  • No obligation, no sales call
  • 5.0 rating on Google and Upwork
  • Reply within one business day
Written by Muhammad UsmanWeb Development Team Lead with 5+ years building WordPress, WooCommerce, Shopify and Wix websites. Experience · Certificates About me

More on Hosting & Migration

All Hosting & Migration articles

Have a project in mind?

Tell me what you're building and I'll reply with next steps and an estimate.