Is this what are you looking for? <?php if (!is_user_logged_in()){ ?> <script type="text/javascript"> function poponload() { testwindow = window.open("http://google.com", "mywindow", "location=1,status=1,scrollbars=1,width=500,height=300"); testwindow.moveTo(0, 0); } poponload(); </script> <?php } ?> PHP: