Viewing 6 replies - 1 through 6 (of 6 total)
  • Yes, this would be good to know.

    If you want all posts to be SSL only, just don’t check the box the says Force SSL Exclusively. I think this option is unfortunately named, b/c I thought it would do the opposite of what it actually does, but the description on the right side of the checkbox is accurate (“Posts and pages without Force SSL enabled will be redirected to HTTP”).

    Thread Starter pv2008

    (@pv2008)

    Hi Joe,

    Yes, I have kept the option you mentioned unchecked.

    The current situation is that if I started off with https on any page/post/”home” page, links to all the posts do start with https so everything is working as expected. Now, if I happen to type in https://domain.com it I will automatically get redirected to https://domain.com (by the plugin I presume) which is also what I expected. However, there is no automatic redirection from http to https for posts/pages, unless I check the option to have https for individual pages. Is THIS the expected behaviour too? I mean, should I be doing this using a redirection plugin instead??

    Thanks.

    Plugin Author mvied

    (@mvied)

    If you want to make your whole site HTTPS, change your Site URL to contain HTTPS.

    Currently the only option for mass-updating posts is writing some custom code to do so.

    $args = array(
    	'numberposts' => -1
    );
    $posts = get_posts($args);
    foreach( $posts as $post ) {
    	update_post_meta($post->ID, 'force_ssl', '1');
    }

    hi Mvied,

    $args = array(
    ‘numberposts’ => -1
    );
    $posts = get_posts($args);
    foreach( $posts as $post ) {
    update_post_meta($post->ID, ‘force_ssl’, ‘1’);
    }

    if i want to enforcing SSL on old posts every time I activate this plugin, where should i put these codes in wordpress-https.php?

    thanks

    Plugin Author mvied

    (@mvied)

    This should work. Just put it in your theme’s functions.php or in your own plugin file.

    register_activation_hook( 'wp-content/wordpress-https/wordpress-https.php', 'wordpress_https_activate' );
    
    function wordpress_https_activate() {
    	$args = array(
    		'numberposts' => -1
    	);
    	$posts = get_posts($args);
    	foreach( $posts as $post ) {
    		update_post_meta($post->ID, 'force_ssl', '1');
    	}
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: WordPress HTTPS (SSL)] Force SSL on old posts’ is closed to new replies.