Security · Guide
How to Install an SSL Certificate on WordPress
Short answer
Install an SSL certificate on WordPress by getting a free Let's Encrypt certificate from your host, then switching the WordPress Address and Site Address to the secure version and fixing any mixed content. Most shared hosts offer the certificate with one toggle, and it renews itself. On a VPS, use Certbot to issue and install it.
Key takeaways
- Let's Encrypt certificates are free, domain-validated only, and last 90 days with renewal every 60 days.
- Most shared hosts install and renew a free certificate for you with one setting.
- Change both site addresses to the secure version, then add define('FORCE_SSL_ADMIN', true); to wp-config.php.
- Mixed content means a secure page loads a resource over plain text; browsers block scripts and stylesheets.
- Check the padlock and run the free Qualys SSL Labs test after installing a certificate.
What does an SSL certificate do for a WordPress site?
An SSL certificate lets a WordPress site use HTTPS, which encrypts traffic between the browser and the server and proves the site is who it claims to be.
HTTPS gives three things: encryption so passwords and form data cannot be read in transit, proof that the server is the real site, and a check that the data was not changed on the way.
WordPress.org's HTTPS guide notes that most major sites use it, and that WordPress is fully compatible with HTTPS once a certificate is installed.
Visitors see the difference at once. With HTTPS the browser shows a padlock, and without it the browser shows a “not secure” label next to the address.
There are also practical gains. WordPress.org's guide notes that many speed improvements to HTTP are only available over HTTPS, so HTTPS usually makes a site faster, and that search engines add a penalty to sites without HTTPS.
Which SSL certificate should you choose?
Choose a free Let's Encrypt certificate for a normal WordPress site, and pay only when you need a warranty or a validation type Let's Encrypt does not offer.
Let's Encrypt is a global certificate authority run as a nonprofit, and its certificates are free. Its FAQ states that it issues Domain Validation certificates only, and has no plans to issue Organization Validation or Extended Validation certificates.
The table below compares the common options for a WordPress site.
| Certificate | Cost | Valid for | Best for |
|---|---|---|---|
| Let's Encrypt | Free | 90 days, auto-renewed | Most WordPress sites |
| Host free SSL | Free | Varies by host | Shared hosting |
| Paid DV | Paid, varies by seller | Varies | Sites that want a warranty |
| Paid OV or EV | Paid, varies by seller | Varies | Companies that need identity checks |
Let's Encrypt certificates last 90 days by default, and Let's Encrypt recommends renewing them every 60 days. The short life is by design: renewal is meant to be automatic, so the certificate never needs a manual renewal.
Check the price of a paid option before buying. See how much an SSL certificate costs.
The free-versus-paid comparison is in Let's Encrypt vs paid SSL.
How do you install a free certificate through your host?
Turn on the free SSL option in your hosting panel, then wait a few minutes and check that the padlock appears.
Most shared hosts now include a free certificate. Let's Encrypt's getting-started guide says many hosting providers get and manage certificates for you, and that it either happens automatically or through a setting you switch on.
The steps differ by host, but the pattern is the same:
- Log in to your hosting panel, such as cPanel, Plesk or your host's custom panel.
- Open the SSL, Security or Domains section.
- Find the free SSL or Let's Encrypt option for your domain and switch it on.
- Wait a few minutes, then open your site with https in front of the address.
If your host uses cPanel AutoSSL, the certificate is issued and renewed by the host with no action from you. Check your host's docs for the exact menu name, since panels differ.
If your host does not offer a free certificate, ask support whether it can install one you bring, or move the site to a host that includes one. Paying for a basic certificate only to get HTTPS is rarely needed now.
How do you install a certificate with Certbot on a VPS?
On a VPS, install Certbot, run one command for your domain, and let Certbot set up the renewal timer.
Let's Encrypt's getting-started guide recommends Certbot as the ACME client for most people. An ACME client is the software that talks to Let's Encrypt, proves you control the domain, and installs the certificate.
On an Ubuntu server with Apache, the steps follow Ubuntu's server documentation:
- Install Certbot from the snap store with
sudo snap install --classic certbot, then link it withsudo ln -s /snap/bin/certbot /usr/local/bin/certbot. - Run
sudo certbot --apache -d example.com -d www.example.com. - Answer the prompts, and let Certbot write the HTTPS settings for you.
- Run
sudo certbot renew --dry-runto confirm renewal works.
Certbot installs a systemd timer that attempts renewal twice a day. A correctly set up server never needs a manual renewal.
Let's Encrypt never stores your private key. Its FAQ states the private key is always generated and managed on your own server, never on its servers.
How do you switch WordPress to HTTPS?
Change both addresses in Settings, then General, to https, and force admin sessions over SSL in wp-config.php.
In your dashboard, go to Settings, then General, and change the WordPress Address and the Site Address from http to https. Save the change, and log in again if WordPress asks.
Then add this line to wp-config.php to force all logins and admin sessions over SSL:
define( 'FORCE_SSL_ADMIN', true );
WordPress.org's HTTPS guide states this constant forces all logins and admin sessions to happen over SSL, and that it must be set in wp-config.php, not in a plugin file. The older FORCE_SSL_LOGIN constant was deprecated in version 4.0.
You must already have SSL configured on the server before setting the constant, or the admin area will stop loading. Install the certificate first, then flip the switch.
The easy route is a plugin. Really Simple Security migrates a site to HTTPS and enforces SSL in one click, with a 301 redirect and secure cookies, according to its WordPress.org plugin page. Its latest release, version 9.8.4, was published on 26 October 2026.
How do you fix mixed content warnings?
Mixed content means an HTTPS page loads a script, image or stylesheet over plain HTTP, so find those URLs and change them to HTTPS.
MDN defines mixed content as a securely loaded page that fetches resources over HTTP or another insecure protocol. Browsers auto-upgrade image, video and audio requests to HTTPS, and block insecure requests for all other resource types, according to MDN.
Scripts are the serious case. MDN notes scripts are particularly dangerous because they can change any part of the page, so browsers block them outright. A blocked script often shows up as a broken menu, a missing style, or a widget that stops working.
Find the bad URLs in your browser's developer tools. Open the page, open the console, and look for mixed content warnings and requests that start with http.
Fix them in this order:
- Change hard-coded http links in posts, widgets and theme settings to https.
- Update image URLs in the media library and in page builder content.
- Check third-party embeds, fonts and scripts, and switch them to their https versions.
Really Simple Security Pro includes a mixed content scan and fixer, and the free plugin handles the redirect. As a stopgap, a Content-Security-Policy header with upgrade-insecure-requests tells browsers to request http resources over HTTPS instead.
How do you force HTTPS and set up redirects?
Redirect every http request to https with a 301 redirect, so no visitor or search engine ever lands on the plain version.
A 301 redirect is permanent, so search engines move the ranking from the http address to the https address. A plugin redirect is the simplest route on shared hosting.
Really Simple Security enforces HTTPS with a 301 redirect through PHP or .htaccess, and sets secure cookies, according to its plugin page. Turn on the redirect in the plugin's onboarding or settings, and it handles the rest.
On a server you manage, add the redirect to your Apache or Nginx configuration instead. Either way, test it after: open http://yoursite.com in a private window and confirm the browser ends up on the https address.
If you use Cloudflare, its SSL settings can also force HTTPS at the edge. See the guide to Cloudflare SSL settings for WordPress for that setup.
How do you check the certificate works?
Open the site in a private window, look for the padlock, and run the free Qualys SSL Labs test for a full report.
First, check the padlock. Click it in the address bar and confirm the certificate names your domain and has a future expiry date. Let's Encrypt certificates last 90 days, so the date should be within the next three months.
Then run the SSL Server Test at Qualys SSL Labs, a free service that performs a deep analysis of a server's SSL configuration. It grades the setup and lists protocol and cipher problems. The test page is at ssllabs.com/ssltest.
Check the redirect too. Open the http address and confirm it moves to https. Then open the dashboard and confirm you stay logged in over https.
If the browser shows an error, see the guide to fixing the ERR_SSL_PROTOCOL_ERROR for the common causes.
What mistakes should you avoid?
The common mistakes are switching WordPress to https before the certificate exists, and forgetting the mixed content cleanup.
Avoid these five:
- Changing the site addresses to https before the certificate is installed
- Setting FORCE_SSL_ADMIN in a plugin file, where WordPress ignores it
- Leaving image and script URLs on http after the switch
- Letting the certificate expire by turning off auto-renewal
- Mixing two SSL plugins that both try to redirect
Let's Encrypt authorizations are cached for up to 30 days, so a renewal that worked once may skip validation the next time. That is normal, not a fault, according to the Let's Encrypt FAQ.
Check the certificate expiry date once a month, even with auto-renewal on. A renewal can fail quietly if a firewall rule blocks the ACME challenge, and an expired certificate shows visitors an error page instead of your site.
Frequently asked questions
Is a free SSL certificate good enough for WordPress?
Yes, in most cases. Let's Encrypt issues free certificates that browsers trust, and most hosts install and renew them for you. Paid certificates only add things most small sites do not need, such as a warranty or an organization check.
How much does an SSL certificate cost for WordPress?
Most shared hosts include one for free through Let's Encrypt or AutoSSL, so you may not need to buy anything. If you do buy a basic certificate, prices usually start near $10 a year, and the cost depends on the type and the seller.
Does installing a certificate switch my site to HTTPS?
No. The certificate only encrypts the connection. A full migration means changing the site addresses to the secure version, forcing admin over SSL, adding a 301 redirect, and fixing mixed content so every resource loads securely.
Why does my browser say the certificate is not trusted?
A certificate error usually means the certificate expired, names a different domain, or was installed on the wrong site. Check the expiry date in the browser, confirm the domain matches, and ask your host to reissue the certificate if the names do not match.
Can I get a wildcard certificate from Let's Encrypt?
Yes, if you need one. Let's Encrypt supports wildcard certificates, but issuance must use the DNS-01 challenge, which means adding a TXT record to your DNS. Check whether your host supports that before choosing a wildcard.
Sources
- Getting Started Let's Encrypt
- FAQ Let's Encrypt
- HTTPS WordPress Developer Resources
- Really Simple Security WordPress.org
- Mixed content MDN Web Docs
- SSL Server Test Qualys SSL Labs
- Obtain TLS certificates Ubuntu
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
