WordPress GuideSecurity → Force HTTPS

How to force HTTPS in WordPress

godaddy exits dedicated hosting

If your WordPress site still loads over HTTP, you’re not just missing out on a small browser icon—you’re putting security, SEO, and trust at risk. Forcing HTTPS ensures every visitor lands on the secure, encrypted version of your site, no matter how they get there.

Let’s look at why it’s important and a few ways to get it done.

What HTTPS is and why it matters

HTTPS (Hypertext Transfer Protocol Secure) encrypts data exchanged between your website and your visitors. It’s essential for protecting passwords, payment info, and other sensitive data. But it’s also important for:

Modern browsers and users expect secure sites. HTTPS is no longer optional.

Why force HTTPS?

Just installing an SSL certificate isn’t enough—many visitors will still reach the insecure version of your site unless you actively redirect them. This happens because:

Forcing HTTPS ensures that anyone visiting your site, no matter how they got there, is automatically redirected to the secure version. 

It also helps consolidate your site’s URL structure, so Google doesn’t see HTTP and HTTPS as separate versions of the same site. Without redirection, you risk content duplication, mixed content warnings, and security holes.

Make sure your SSL certificate is active

You can’t force HTTPS without an SSL certificate. Here’s how to check:

If you don’t have an SSL certificate, most hosts offer free options via Let’s Encrypt.

Update your WordPress settings

WordPress stores your site’s URL, and you need to update it to HTTPS:

Force HTTPS using a plugin (easy method)

The simplest way to enforce HTTPS across your entire site is with a plugin. The most popular choice is Really Simple Security (formerly Really Simple SSL):

This handles redirects, mixed content, and most edge cases without code.

Force HTTPS with .htaccess (manual method for Apache)

If you prefer a manual solution or want tighter control, you can edit your .htaccess file. This only applies to Apache servers:

Force HTTPS with NGINX (alternative to Apache)

If your site runs on NGINX, you’ll need to update the server block:

Make sure you have a valid SSL block for port 443 before enabling the redirect.

Fix mixed content warnings

Even if HTTPS is enabled, your site might still load some resources (like images, scripts, or stylesheets) over HTTP. This triggers mixed content warnings.

Fix them by:

Test your site over HTTPS

Once everything’s in place, test your site:

Final tips and troubleshooting

After forcing HTTPS, there are a few final steps to fully transition your WordPress site and avoid any lingering issues. These tips help reinforce the redirect and keep your analytics and SEO data accurate.

Additional resources

Comprehensive guide to securing WordPress with ModSecurity

This guide provides a comprehensive overview of how to use ModSecurity to enhance the security of your WordPress site.

WordPress malware removal techniques to try →

Learn effective methods to detect and remove malware from your WordPress site for enhanced security.






Why security matters for WordPress enterprise hosting

Use the blog as your guide to attacks to watch out for, security best practices, and steps to improve the WordPress protection you already have.