Assuming you’re trying to get rid of the ?redirect_to={url}
, you can use the login_url
filter to change the login URL, and remove unwanted querystring components with remove_query_arg()
:
add_filter( 'login_url', 'wpse422493_strip_login_url' );
/**
* Strips `redirect_to` from the querystring.
*
* @param string $url The login URL.
* @return string The filtered login URL.
*/
function wpse422493_strip_login_url( $url ) {
return remove_query_arg( 'redirect_to', $url );
}
Note: This code is untested and intended as a starting point only, not as finished, production-ready code. Make sure you test it in a non-production environment before you use it in production.
Related Posts:
- 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?
- Generate one time URL
- 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
- home_url(); showing current page instead of site address
- URL parsing – what is it?
- Components used in Themes and Plugins: How to get file URL?
- Can URL remain the same if migrating from Drupal?
- Site URL always in front of other URLs
- Easiest way to simulate WordPress’s URL resolution to retrieve post ID, etc?
- How to add domain security certification, in WordPress website?
- Imported thumbnails have incorrect URL
- Is it necessary to check for `content-type` in headers?
- How to allow — in category name
- Request parameters in $_GET do not match URL called
- WordPress custom search url
- The requested URL was not found only on localhost
- Allow Chinese character on post URL slug
- How can I change a media attachment URL/slug, so that I can use that slug for a page?
- Problem with utf8 link
- remove query string from homepage url
- Twitter shortlink 404 not found [closed]
- Remove Trailing Slash from Category Base and Tag Base
- How to handle this URL Structure. Keep getting “page not found”
- Custom url in wordpress
- WP URL /icons returns 403 forbidden error
- Get root folder without domain
- wordpress.com website url structure [closed]
- HTTP 403 Error when passing parameters to URL
- WordPress get parameter ‘unapproved’ and ‘moderation-hash’
- How to remove my website link when adding a link?
- Misentered the site address url. How to recover? [closed]
- How to make pages slug have priority over any category
- How to call for bloginfo inside function in functions.php?
- Website Address Keep redirect to website after migration attempt
- Random string added end of the url blog page wordpress [closed]
- Custom HTML title based on URL parameter
- Can’t change the wordpress site url
- Relative URLs within site
- Blog post – single.php url
- Using WordPress for a site’s static marketing pages and blog at different URLs
- WordPress File URL Path Incorrect
- Adding more onto an esc_url [closed]
- What is the best way to revert to www version of domain name?
- Need to check if user is on a particular page
- How can I insert a dynamic URL in my email template?
- How to set path to the image instead of alt in media.php?
- Block registration by URL referrer?
- Localhost access after changing URL
- Make unique url to unlock a post
- Changing url of author page
- How to get previous and Next Post Url in the_post_navigation
- Changing siteurl in the database not working
- Why my WordPress website homepage automatically adding cs_preview=true query parameter to the url?
- append currency to URL
- URL redirects of webpage
- What is this extension on mu web URL?? It leads to a blank page. what is causing it/?
- Create 600 links to separate files on google drive
- Incorrect page shown
- 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]
- URL Structure for translated articles
- WP site homepage displays url link at beginning of each featured post
- Custome home page url
- Unable to login after changing WordPress site url
- Inject dynamic strings in urls
- Why is my WordPress URL shortened
- Pass post title as URL parameter
- How do I make images open in a new tab by default?
- How to pass parameters thru URL?
- Domain name to a page
- How to get the correct URL on my wordpress site?
- Text widget form and URL variables
- How to redirect WP post with a specific word in the URL
- Making a site URL
- Options and template changes not updating
- Append custom parameter to taxonomy/term URI
- Avoid too long words in a post title, post content or comment but only if its not a url
- Change URL to filter posts
- 404 error on cyrillic url
- Accidentally changed the url
- WordPress rewrites my link with custom URL scheme to http(s)
- Show page name after home url
- How to create multiple urls for a same page contents in wordpress
- how to add param string after website url in wordpress?
- Are the wp entries in these URL’s legitimate?