Title: post preview button gives http link even if admin is using https
Last modified: August 30, 2016

---

# post preview button gives http link even if admin is using https

 *  [chrishecker](https://wordpress.org/support/users/chrishecker/)
 * (@chrishecker)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/post-preview-button-gives-http-link-even-if-admin-is-using-https/)
 * I think this is probably a bug, but I’m not sure.
 * If you’ve got FORCE_SSL_ADMIN on and are editing a new post in the admin UI (
   via https), if you hit the Preview button, it creates a http link to the preview
   page. It seems like it should generate an https link.
 * Combined with making the logged_in cookie secure using this
 * add_filter(‘secure_logged_in_cookie’,’__return_true’);
 * means you can’t preview posts. I hacked around it with this:
 * add_filter( ‘preview_post_link’, ‘my_preview_post_link_https’, 10, 2 );
    function
   my_preview_post_link_https( $link, $post ) { if($_SERVER[‘HTTPS’] == ‘on’) { 
   return preg_replace(“/^http:/”,”https:”,$link); } else { return $link; } }
 * but it seems like this shouldn’t be necessary. I guess all this ssl admin stuff
   is relatively new, but it seems like this is a bug to me.
 * Chris

The topic ‘post preview button gives http link even if admin is using https’ is 
closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [chrishecker](https://wordpress.org/support/users/chrishecker/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/post-preview-button-gives-http-link-even-if-admin-is-using-https/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
