Enable SSL in WordPress: A Step-by-Step Guide to HTTPS Security

Enable SSL in WordPress: A Step-by-Step Guide to HTTPS Security

Securing your site with HTTPS is no longer optional — and enabling WordPress SSL is easier than you think. This step-by-step guide walks you through certificate issuance, server setup, WordPress configuration, and maintenance so your site enjoys encryption, improved SEO, and fewer mixed-content problems.

Securing a WordPress site with HTTPS is no longer optional — search engines, modern browsers, and users expect encrypted connections by default. This guide walks you through the technical process of enabling SSL on WordPress, from certificate issuance to server configuration, WordPress settings, and ongoing maintenance. It is written for site owners, developers, and administrators who host WordPress on VPS or managed environments and need a reliable, secure deployment strategy.

How HTTPS Works and Why It Matters

At a high level, HTTPS uses TLS (Transport Layer Security) to encrypt HTTP traffic between a client (browser) and your server. When TLS is properly configured, data in transit is protected from eavesdropping and tampering. The TLS handshake also authenticates your server using a digital certificate issued by a trusted Certificate Authority (CA).

Key security properties provided by TLS:

  • Encryption — protects data confidentiality.
  • Integrity — prevents modification of content in transit.
  • Authentication — verifies the server’s identity to clients.

For WordPress sites, HTTPS also improves SEO rankings, enables HTTP/2 and HTTP/3 support for better performance, and prevents mixed-content warnings that can break functionality or disrupt analytics and cookies.

Certificate Types and Issuance Options

Choose a certificate type based on your needs:

  • Single-domain (e.g., example.com or www.example.com)
  • Wildcard (e.g., *.example.com — secures all first-level subdomains)
  • Multi-domain / SAN (Subject Alternative Name) certificates — for multiple distinct hostnames

Issuance options:

  • Let’s Encrypt — Free, automated certificates with 90-day validity. Ideal for most sites and highly automatable via Certbot or ACME clients.
  • Paid CAs (DigiCert, Sectigo, etc.) — Offer extended validation, longer lifetimes, and additional assurances/support. Useful for enterprise needs.
  • Managed CA from hosting control panels (cPanel/ISPConfig/Plesk) — Simplifies issuance and auto-renewal via the control panel.

Server and WordPress Requirements

Before proceeding, check your environment:

  • Server type and control plane: Apache, Nginx, or a reverse proxy (HAProxy, Cloudflare) on a VPS.
  • Root or sufficient privileges to install certs and change virtual host configuration.
  • WordPress configuration access — wp-config.php and the database for URL updates if needed.
  • Ports 80 and 443 open in your firewall for ACME validation and HTTPS traffic.

Step-by-Step: Enabling SSL with Let’s Encrypt on a VPS

1. Prepare your VPS

Update packages and ensure required tools are installed (example for Debian/Ubuntu):

  • sudo apt update && sudo apt upgrade -y
  • Install Certbot (ACME client): sudo apt install certbot python3-certbot-nginx (or python3-certbot-apache)

2. Obtain a certificate using Certbot

For Nginx:

  • sudo certbot –nginx -d example.com -d www.example.com

For Apache:

  • sudo certbot –apache -d example.com -d www.example.com

Certbot will perform ACME validation (usually HTTP-01) by provisioning a temporary token on port 80 and then obtain and install the certificate. For DNS-01 validation (needed for wildcards), use the –manual plugin or an API-based DNS plugin.

3. Configure web server for HTTPS

Certbot’s installer can auto-configure Nginx/Apache. If you manage configuration manually, ensure:

  • Your server block / virtual host listens on port 443 and references the certificate and key files (chain file included).
  • Use strong TLS settings: disable TLS 1.0/1.1, prefer TLS 1.2+ and 1.3, and enable secure ciphers. Example (Nginx):

ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers set to a modern, secure suite; enable ssl_prefer_server_ciphers on; and configure ssl_session_cache.

Also enable HTTP/2 for performance if supported: add listen 443 ssl http2; in Nginx server block.

4. Redirect all HTTP to HTTPS

Ensure a permanent 301 redirect from http:// to https://. For Nginx:

  • server { listen 80; server_name example.com www.example.com; return 301 https://$host$request_uri; }

This preserves SEO authority and forces browsers to use secure connections. Avoid redirect loops by ensuring WordPress detects HTTPS correctly (see WordPress settings below).

5. Update WordPress to use HTTPS

Change WordPress Address (URL) and Site Address (URL) to https:// via:

  • WP admin Settings → General (if accessible)
  • Or in wp-config.php: define(‘WP_HOME’,’https://example.com’); define(‘WP_SITEURL’,’https://example.com’);
  • Or update in the database with WP-CLI or SQL: UPDATE wp_options SET option_value = replace(option_value, ‘http://example.com’, ‘https://example.com’) WHERE option_name IN (‘home’,’siteurl’);

6. Fix mixed content

Mixed content occurs when resources (images, scripts, stylesheets) are loaded over HTTP. Use the following approaches:

  • Search and replace the database for http://example.com to https://example.com (take a backup). Tools: WP-CLI search-replace, Better Search Replace plugin, or interconnect/it Search Replace DB.
  • Use relative protocol-less URLs or HTTPS-only URLs when coding themes/plugins.
  • For dynamic content, ensure third-party scripts support HTTPS or remove/replace them.

Test pages in browser devtools (Console tab) and use online scanners such as Why No Padlock to find mixed content sources.

WordPress-Specific Considerations and Plugins

Plugins can help simplify the transition, but they should not replace correct server configuration.

  • Really Simple SSL — Handles URL rewriting and some mixed content fixes. Useful for non-technical admins but best used as a temporary layer while addressing root causes.
  • Caching plugins (WP Super Cache, WP Rocket) — Reconfigure caches to serve HTTPS content and purge cache after switching.
  • Security plugins (Wordfence, Sucuri) — Re-scan after HTTPS activation to verify there are no security regressions.

Advanced Hardening and Performance Tweaks

After enabling HTTPS, consider these steps:

  • Enable HSTS (HTTP Strict Transport Security) to instruct browsers to always use HTTPS. Example header: Strict-Transport-Security: max-age=63072000; includeSubDomains; preload. Note: HSTS is irreversible for cached browsers — test carefully before including preload.
  • OCSP Stapling — reduces TLS handshake latency by stapling certificate revocation status to the TLS handshake. Enable on Nginx/Apache if supported.
  • Enable HTTP/2 or HTTP/3 — improves parallelism and throughput for many small assets. HTTP/3 requires QUIC support at the server and a compatible stack (e.g., Cloudflare or a web server with QUIC implementation).
  • Implement TLS session resumption and optimized cipher suites to reduce CPU cost on TLS handshakes.

Renewals and Monitoring

Let’s Encrypt certificates expire every 90 days. Automate renewals:

  • Certbot typically installs a cron job or systemd timer: certbot renew –quiet
  • Test renewal with: sudo certbot renew –dry-run
  • For DNS-01 or custom scripts, ensure your automation updates DNS records or uses API keys for your DNS provider.

Monitor certificate validity and expiration using server monitoring tools, uptime services, or third-party certificate monitoring to avoid downtime from expired certs.

Common Troubleshooting

Typical issues and quick checks:

  • 502/504 after enabling HTTPS — check backend/ reverse proxy forwarding and proper SSL termination.
  • Redirect loops — ensure WordPress site URLs are set to HTTPS and the web server’s redirect rules are correct. Also check reverse proxy headers like X-Forwarded-Proto when behind a load balancer.
  • Mixed content remains — clear any caches (server, CDN, WordPress) and inspect the page source for hardcoded http:// links.
  • Certificate not trusted — verify the full chain (certificate + intermediate chain) is configured correctly in your virtual host.

Choosing a Hosting Environment for HTTPS

When selecting infrastructure for WordPress with HTTPS in mind, consider:

  • Root access vs managed hosting — VPS gives full control over TLS settings and performance tuning; managed hosts simplify operations but can limit low-level configuration.
  • Network performance and location — choose VPS nodes closer to your audience to reduce latency for TLS handshakes. Consider providers with a global footprint and DDoS protections.
  • Automated tools — look for providers that support One-Click Let’s Encrypt issuance or provide native certificate management for easier operations.
  • Scalability — if expecting variable traffic, pick VPS plans that allow vertical scaling (CPU, RAM) and easy network upgrades to maintain TLS performance under load.

Conclusion

Enabling SSL and migrating WordPress to HTTPS is a critical, multi-step process involving certificate issuance, server configuration, WordPress settings, mixed-content remediation, and ongoing renewal automation. Properly executed, HTTPS increases security, improves SEO, enables modern protocols like HTTP/2/3, and builds trust with visitors. For teams running WordPress on virtual private servers, having full control over the server stack is a major advantage for tuning TLS, enabling advanced features such as OCSP stapling and HTTP/3, and integrating automated certificate workflows.

If you’re setting up or migrating a WordPress site and need reliable VPS infrastructure with global presence, consider VPS.DO. Their USA VPS plans offer scalable resources and full root access suitable for managing secure TLS configurations and WordPress performance tuning. Learn more: VPS.DO and view the USA VPS options here: https://vps.do/usa/.

Fast • Reliable • Affordable VPS - DO It Now!

Get top VPS hosting with VPS.DO’s fast, low-cost plans. Try risk-free with our 7-day no-questions-asked refund and start today!