Redirect unauthenticated users to the login page.
By default, Live Preview will show a login form if a user is not logged in or does not have the permissions to preview a form.
In some situations, these pages can be indexed by search engines. To remedy this,
this snippet redirects to wp-login.php
instead of showing a login form.
Installation:
Instructions
See “Where do I put snippets?” in our documentation for installation instructions.
Code
Filename: gplp-redirect-to-wp-login.php