Password protected page Hash url

The issue is that the browser doesn’t pass the hash value in the request, it is parsed by the browser itself. Since the server doesn’t know about the hash it can’t forward it along after the login. You do have access to the hash with javascript though…Without seeing your code I can’t give you a specific answer but something like this would probably work:

Assuming you are using wp_login_form(), otherwise change the selectors accordingly

<script>
jQuery(document).ready(function($){
    $redirectField = $('input[name="redirect_to"]');
    $redirectField.val($redirectField.val() + window.location.hash);
});
</script>

You could include that on every page, or better would be to include it using the login_form_bottom filter.