# Configuring WordPress to always use SSL

> Make your WordPress site load over HTTPS every time by updating its URLs in the settings or database and forcing SSL in .htaccess.

Source: https://helpcenter.ruachost.com/wordpress/guides/configuring-wordpress-to-always-use-ssl/

Enabling **SSL (Secure Sockets Layer)** ensures that all traffic between your WordPress site and visitors is encrypted. This improves security, builds trust, and is essential for SEO. On **ruachost.com**, you can configure WordPress to always use SSL once you have a valid certificate installed.

## Why Force SSL?

- Protects sensitive data (logins, payments, personal info).
- Prevents “Not Secure” browser warnings.
- Improves search engine ranking.
- Builds visitor confidence in your site.

## Steps to Configure WordPress to Always Use SSL

### Method 1: Update WordPress Settings

1. **Log in to WordPress** as an administrator.
2. Go to **Settings → General**.
3. Update both fields:

   - **WordPress Address (URL)** → `https://yourdomain.com`
   - **Site Address (URL)** → `https://yourdomain.com`
4. Click **Save Changes**.
5. Log back in using the secure URL.

### Method 2: Update via phpMyAdmin (Advanced)

If you cannot access the WordPress dashboard:

1. **Log in to cPanel** (or your hosting panel).
2. Open **phpMyAdmin**.
3. Select your WordPress database.
4. Open the **wp_options** table.
5. Locate and edit the following rows:

   - `siteurl` → set to `https://yourdomain.com`
   - `home` → set to `https://yourdomain.com`
6. Save changes.

### Method 3: Force SSL with `.htaccess`

To ensure all traffic is redirected to HTTPS:

1. Connect to your site via FTP or File Manager.
2. Open the `.htaccess` file in your WordPress root directory.
3. Add the following lines at the top:

   ```
   
   RewriteEngine On
   RewriteCond %{HTTPS} off
   RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
   
   ```
4. Save the file.
5. Test your site → All requests should now redirect to HTTPS.

## Important Notes

- Ensure you have a valid SSL certificate installed before forcing HTTPS.
- Incorrect settings may make your site inaccessible, always back up before changes.
- Clear your browser cache and WordPress cache after enabling SSL.
