Title: [Plugin: WordPress HTTPS (SSL)] Force SSL for users
Last modified: August 20, 2016

---

# [Plugin: WordPress HTTPS (SSL)] Force SSL for users

 *  Resolved [Christopher Holloway](https://wordpress.org/support/users/mr091/)
 * (@mr091)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-for-users/)
 * I want to be able for when users log in to my site that they stay on the secure
   side throughout the whole time they are logged in and when they log out they 
   are taken back to a non secure side just as the admin area is done in this plugin??
 * [http://wordpress.org/extend/plugins/wordpress-https/](http://wordpress.org/extend/plugins/wordpress-https/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-for-users/#post-2776481)
 * So you want to secure all links for logged in users?
 * You could do that pretty easily by adding this to your theme’s functions.php:
 *     ```
       function logged_in_force_ssl( $force_ssl, $post_id ) {
           if ( is_user_logged_in() ) {
               $force_ssl = true;
           }
           return $force_ssl;
       }
       add_filter('force_ssl', 'logged_in_force_ssl', 10, 2);
       ```
   
 * It may not work perfectly. Let me know.
 *  Thread Starter [Christopher Holloway](https://wordpress.org/support/users/mr091/)
 * (@mr091)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-for-users/#post-2776504)
 * thanks very much. this works great. but i am wondering, when logged out, it doesn’t
   go back to the non secure version of my site. is there a way to force it to be
   non secure http when not logged in?
 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-for-users/#post-2776519)
 * Same code, add an else statement.
 *     ```
       function logged_in_force_ssl( $force_ssl, $post_id ) {
           if ( is_user_logged_in() ) {
               $force_ssl = true;
           } else {
               $force_ssl = false;
           }
           return $force_ssl;
       }
       add_filter('force_ssl', 'logged_in_force_ssl', 10, 2);
       ```
   
 *  [G](https://wordpress.org/support/users/gnetworkau/)
 * (@gnetworkau)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-for-users/#post-2776834)
 * [@mvied](https://wordpress.org/support/users/mvied/)
    I tried the above code,
   but had problem – white screen of death… So too trying your WordPress https plugin.
 * I want ssl active for logged in users, http for guests.
 * WordPress 3.5 (Network), Buddypress 1.6.2, WP-Super-cache 1.2
 * Any ideas?
 *  [G](https://wordpress.org/support/users/gnetworkau/)
 * (@gnetworkau)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-for-users/#post-2776837)
 * this works:
 * [http://wordpress.org/extend/plugins/ssl-for-logged-in-users/](http://wordpress.org/extend/plugins/ssl-for-logged-in-users/)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: WordPress HTTPS (SSL)] Force SSL for users’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-https_bec2c9.svg)
 * [WordPress HTTPS (SSL)](https://wordpress.org/plugins/wordpress-https/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-https/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-https/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-https/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-https/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-https/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [G](https://wordpress.org/support/users/gnetworkau/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-for-users/#post-2776837)
 * Status: resolved