Title: [Plugin: WordPress HTTPS (SSL)] force_ssl on ALL pages?
Last modified: August 20, 2016

---

# [Plugin: WordPress HTTPS (SSL)] force_ssl on ALL pages?

 *  [GenoGod](https://wordpress.org/support/users/genogod/)
 * (@genogod)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force_ssl-on-all-pages/)
 * I’ve found this code on the FAQ page but there wasn’t much information.
 *     ```
       function custom_force_ssl( $force_ssl, $post_id ) {
           if ( $post_id == 5 ) {
               return true
           }
           return $force_ssl;
       }
       add_filter('force_ssl' , 'custom_force_ssl', 10, 2);
       ```
   
 * I’m not great at PHP but from what I can tell, that’s just to secure one page.
 * So instead I added
 * `force_ssl == true;`
 * to the header.php file in my theme folder but it still seems it isn’t catching.
 * What am I missing?
 * Secure site: [https://floridaga.net](https://floridaga.net)
    Insecure page: [http://floridaga.net/members/occupyflorida/](http://floridaga.net/members/occupyflorida/)
 * How the heck do I lock down the entire site??
 * [http://wordpress.org/extend/plugins/wordpress-https/](http://wordpress.org/extend/plugins/wordpress-https/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force_ssl-on-all-pages/#post-2434886)
 * Hey GenoGod,
 * So you put this?
 *     ```
       function custom_force_ssl( $force_ssl, $post_id ) {
           if ( $force_ssl == true ) {
               return true
           }
           return $force_ssl;
       }
       add_filter('force_ssl' , 'custom_force_ssl', 10, 2);
       ```
   
 * If so, that won’t do anything except return true when $force_ssl is already true.
 * You would use this to make every page Force SSL:
 *     ```
       function custom_force_ssl( $force_ssl, $post_id ) {
           $force_ssl = true;
           return $force_ssl;
       }
       add_filter('force_ssl' , 'custom_force_ssl', 10, 2);
       ```
   
 * You place that code block in the functions.php of your theme. If it doesn’t exist,
   create it. Using this code is essentially the same as setting your whole site
   to HTTPS. You may want to consider doing that instead.
 * Thanks,
    Mike

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: WordPress HTTPS (SSL)] force_ssl on ALL pages?’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [mvied](https://wordpress.org/support/users/mvied/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force_ssl-on-all-pages/#post-2434886)
 * Status: not resolved