• Resolved Justin Fletcher

    (@justinticktock)


    Hi all,

    I’ve been through many hours, over many months, of trialling different ways of enforcing SSL on the site front end. I’ve mainly used the WordPress MU Domain Mapping plugin along with a whole bunch of security plugins to attempt to enforce https on the front end but none seem to handle it for me.

    so I thought I’d ask the question .. “what’s the right way to do this with wordpress?” is there a core method coming as simple as the define('FORCE_SSL_ADMIN', true); ?

    thanks for your thoughts..

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    The best way: https://wordpress.org/plugins/wordpress-https/

    Admittedly, you CAN do a search and change http to https for the site in your DB, but it’s spotty.

    Thread Starter Justin Fletcher

    (@justinticktock)

    Thanks I guess then the way to do the enforcing is via theme and the function.php..

    //https://wordpress.org/plugins/wordpress-https/faq/
    function custom_force_ssl( $force_ssl, $post_id = 0, $url = '' ) {
        $force_ssl = true;
        return $force_ssl;
    }
    
    add_filter('force_ssl' , 'custom_force_ssl', 10, 3);
    Thread Starter Justin Fletcher

    (@justinticktock)

    then just one more addition to remove the necessary metaboxes from all post type edit pages in admin..

    // remove the ssl meta box from post/page edit screen.
    function ssl_metabox_remove() {
    		$post_types = get_post_types( array( 'public' => true ) );
    
    		foreach ( $post_types as $post_type ) {
    			remove_meta_box( 'wordpress-https', $post_type ,'side' );
    		}
    
    }
    add_action( 'add_meta_boxes', 'ssl_metabox_remove',100 );
    Thread Starter Justin Fletcher

    (@justinticktock)

    and finally looks like a setting of ‘Secure Filters’ needs to be set for = “/” so that the site is forced to SSL.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘What is the right way to do enforce frontend SSL on Multisite ?’ is closed to new replies.