Skip to main content

How to Force a WordPress Site to Use HTTPS

You can force your WordPress site to use HTTPS to ensure that all traffic and data transmitted between your visitors and your server are encrypted. This procedure is intended for Site Administrators and ensures that the WordPress configuration...

You can force your WordPress site to use HTTPS to ensure that all traffic and data transmitted between your visitors and your server are encrypted. This procedure is intended for Site Administrators and ensures that the WordPress configuration correctly recognizes your site's secure URL.

Before you begin

You will need:

  • Administrator access to your WordPress dashboard.

  • A valid SSL certificate installed on your domain.

  • Access to your WordPress configuration files (via FTP or a File Manager).

Update WordPress Site URLs

To ensure WordPress generates the correct links and redirects, you must update the site's internal URL settings.

  1. Log in to your WordPress dashboard.

  2. Navigate to Settings > General.

  3. Locate the WordPress Address (URL) and Site Address (URL) fields.

  4. Change the protocol from http:// to https:// in both fields.

  5. Scroll to the bottom of the page and click Save Changes.

Force HTTPS via .htaccess

If your site still allows users to access the non-secure version, you can add a rule to your .htaccess file to force a redirect.

  1. Access your site's root directory using an FTP client or a File Manager.

  2. Locate the .htaccess file in the root directory.

  3. Open the file and add the following code at the top of the file:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Confirm the result

  • Navigate to your website's homepage.

  • Verify that the browser displays a padlock icon in the address bar.

  • Click the link to any internal page to ensure the URL remains on the https:// protocol.

Limitations

This procedure does not automatically fix "Mixed Content" warnings. If your site still shows a warning that some resources (like images or scripts) are loaded over HTTP, you may need to update those specific URLs within your content or via a search-and-replace tool.

Did this answer your question?