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.
Related Posts:
- Displaying Post with Custom URL with RewriteRule or add_rewrite_rule
- Use wp_redirect to add a parameter
- Difference between esc_url() and esc_url_raw()
- Remove All Query Arg
- Pulling a parameter out of the URL of a WP link without “?” or being sent to a different page
- Run WordPress frontend and backend in different domains
- How to set global variable in functions.php
- Can’t login after my site was moved to a new server
- Adding a hook to ‘parse_request’ so that siteurl/pagename/xyz ignores “xyz”
- How to have numeric URLs in Posts and Pages
- Why WordPress automatically removes http from the url of my website’s sub domain?
- WordPress Move to SSL How to Update Media Assets to HTTPS?
- Moving wp-content outside of web root?
- Adding target and _blank as it’s value to the allowedtags
- permalink for category pages and posts
- Get url from file uploaded in Media Library
- Allow UTF-8 characters in the user slug part of URL
- WordPress converting ../url to http://../url
- URL parsing – what is it?
- Components used in Themes and Plugins: How to get file URL?
- Site URL always in front of other URLs
- Easiest way to simulate WordPress’s URL resolution to retrieve post ID, etc?
- Moving a test WP site to live
- How do I write the link from front-page.php to home.php?
- how to make URL link query string
- Adding rewrite rule dynamically for search results redirecting to 404 URL
- Allow Chinese character on post URL slug
- Problem with change url for all subpages (.htaccess)
- Newline URL entity when using esc_url()
- How to handle this URL Structure. Keep getting “page not found”
- Custom url in wordpress
- How to auto gen. custom post type values in other custom post type in url?
- How do I Redirect a WordPress Page?
- WordPress get parameter ‘unapproved’ and ‘moderation-hash’
- store URL global before we redirect
- URL issue after migrating to dev site
- Misentered the site address url. How to recover? [closed]
- Renamed my website (URL) – how do I rename all within-page links to the old URL?
- How to call for bloginfo inside function in functions.php?
- What can I replace ‘.get_bloginfo(‘url’).’ with to return the current URL rather than the home address?
- How to get CGI variables?
- What is the best way to figure out which template file that a “pretty permalink” is using?
- WordPress Subcategory Creates 2 urls for same page (serious issue)
- How to fix automatic redirects?
- How to see an item in the admin from its URL? (not sure if it’s a page, post, or what)
- Can’t change the wordpress site url
- Cannot access WordPress website from external IP while internally it is working properly [closed]
- Pass form input via url variable
- Rewrite Most WordPress URLs
- Relative URLs within site
- How to make WordPress urls matching static html urls
- Using WordPress for a site’s static marketing pages and blog at different URLs
- What is the best way to revert to www version of domain name?
- Need to check if user is on a particular page
- Hook for feed creation?
- How to set path to the image instead of alt in media.php?
- Go back to my home page
- Changed domain name and all the 301 redirects work except the ones for the thumbnail image which return 403 Forbidden error
- Changing url of author page
- How to get previous and Next Post Url in the_post_navigation
- How to redirect a child page to its parent page?
- Can non-latin characters appear in slugs?
- Encode URL for WhatsApp “click to chat” without loosing accented characters
- append currency to URL
- Create 600 links to separate files on google drive
- Locked myself out of WordPress because I changed my URL and computer shut down
- Cant access my wordpress.org locally
- I changed the URL [closed]
- WP site homepage displays url link at beginning of each featured post
- how to set url in admin option page
- Unable to login after changing WordPress site url
- WordPress Protected Page Redirects to PDF
- using wp_rewrite but keep the original url in the address bar
- Why is my WordPress URL shortened
- What does this structure of the URL mean? http://www.example.com/?i=0
- How to create URL for Pages/Posts
- Private Messages between users
- Navigation and Permalink not getting correctly
- How to get the correct URL on my wordpress site?
- WordPress custom form post to different page
- Two domain site: Link base URLs point to wrong domain
- How to redirect WP post with a specific word in the URL
- Add an access code form to call a unique page based on page without registration
- Duplicate content with the same URL, google authorship
- Making a site URL
- Avoid too long words in a post title, post content or comment but only if its not a url
- Change URL to filter posts
- Modify WordPress to not replace + (plus) characters from URLs?
- How to remove slug from url (custom post type)
- Accessing a file saved outside webroot in a wordpress post
- Why my wordpress site URL does not begin with my domain?
- Is There a Way to Schedule URL to Content Updates?
- I changed my url and cant access my site, Help?
- Accidentally changed the url
- Select Tab name to show in browser’s URL
- How to make media URLs Unique
- Replace media external links with local links
- WordPress rewrites my link with custom URL scheme to http(s)
- Show page name after home url
- how to add param string after website url in wordpress?