Title: [Plugin: WordPress HTTPS (SSL)] Force SSL on old posts
Last modified: August 20, 2016

---

# [Plugin: WordPress HTTPS (SSL)] Force SSL on old posts

 *  Resolved [pv2008](https://wordpress.org/support/users/pv2008/)
 * (@pv2008)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-on-old-posts/)
 * Hi,
 * I was wondering what is the recommended way of enforcing SSL on old posts, i.
   e. posts or pages which have been published before the plugin has been installed?
   I have over 100 posts/pages and it will be quite a pain to have to tick the checkbox
   for all of them.
 * Thanks!
 * [http://wordpress.org/extend/plugins/wordpress-https/](http://wordpress.org/extend/plugins/wordpress-https/)

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

 *  [pbassham](https://wordpress.org/support/users/pbassham/)
 * (@pbassham)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-on-old-posts/#post-2734598)
 * Yes, this would be good to know.
 *  [joe.toomey](https://wordpress.org/support/users/joetoomey/)
 * (@joetoomey)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-on-old-posts/#post-2734599)
 * 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](https://wordpress.org/support/users/pv2008/)
 * (@pv2008)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-on-old-posts/#post-2734601)
 * 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 [http://domain.com](http://domain.com) 
   it I will automatically get redirected to [https://domain.com](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](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-on-old-posts/#post-2734607)
 * 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');
       }
       ```
   
 *  [andyhung](https://wordpress.org/support/users/andyhung/)
 * (@andyhung)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-on-old-posts/#post-2734638)
 * 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](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-on-old-posts/#post-2734651)
 * 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.

 * ![](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/)

 * 6 replies
 * 5 participants
 * Last reply from: [mvied](https://wordpress.org/support/users/mvied/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-force-ssl-on-old-posts/#post-2734651)
 * Status: resolved