Instead of your code why don’t you try which in the codex example.
This simple example will redirect a user to the home_url()
upon successful registration.
add_filter( 'registration_redirect', 'my_redirect_home' );
function my_redirect_home( $registration_redirect ) {
return home_url();
}
Related Posts:
- Redirect user after login/registration globally
- How to auto login after registration? [duplicate]
- Redirect User to login page
- How do I redirect the browser to 404 page, if no posts are found in home page
- How to redirect new registrars to a custom registration page instead of WP default registration page?
- wp_redirect() function is not working
- Redirect page URL to home URL without using a plugin
- Why is wp_redirect() preferable to a standard PHP header redirect?
- How to redirect a sucessful registration to a page template?
- WordPress HTTPS redirect loop
- Password change when the user login first time
- Redirect to custom url when registration fails?
- Restrict Access to wp-login.php
- Redirect to custom URL after registering from a page with registration form
- Stop unwanted WP redirection to new url
- Redirecting to home-page when saving any edited code
- wp-login.php — redirect logged in users to custom URL
- Redirect to “All Posts” after post update or publish in Block Editor
- Random and Erroneous WordPress Redirect
- Temporary redirect prevents getting $_POST array
- URL Redirect and Bulk Actions in wp_list_table
- How to redirect only if page doesn’t exists
- How To Only Allow Users To View Their Own Buddypress Profiles? [closed]
- https multiple redirects
- Custom Registration page – prevent redirect to wp-login.php?action=register
- How to modify the Register link in the login page?
- header and wp_redirect not working. cannot modify header information warning
- Code to create a redirection after login?
- Redirect home to another page with htaccess
- How do I redirect /search/ to ?s=
- WordPress Global Redirect
- Why does wp_redirect strip out %0A (url encoded new line character) and how do I make it stop?
- How to set up a single portfolio page as home page?
- Redirect if $_Server[‘REQUEST_URI’] is /wp-login.php?checkemail=registered
- Redirect Logged In User if page is wp-login.php and $_Get[‘level’] = X
- Any action in wordpress redirects me to home page
- How to use Regex to add to a url?
- Stuck In a Redirect Loop
- How can I replace my primary url globally with a parked one?
- Can I change default registration link (without htaccess)?
- Front end user creation form! How do you keep the user on the same page in event of error?
- Adding rewrite rule dynamically for search results redirecting to 404 URL
- How to redirect if a background request is still being executed
- How To Redirect /url.html to /url?
- I get redirected too many times only in wp-admin?
- Redirect user to previous page after signup from custom form
- Get query parameters from external url and make a redirection
- wordpress_redirect returns different headers for HEAD and GET requests
- Remove #wpcf7-f2450-o1 with Contact form 7 redirect [closed]
- Show different page for first time user
- Login/Register redirect user with message
- Redirect outside WP after login
- HTML Redirect to WP pages
- store URL global before we redirect
- wp_redirect () doesn’t work in nginx?
- Redirect Attachment Page to Attachment
- How to redirect from one WP site to another
- Extra Text in URL
- Redirect /home to home.php
- How do I write a subdomain redirect?
- How to fix automatic redirects?
- Create header.php redirect in WordPress and with WPML
- Missing domain http://./wp-… in redirects
- Why I am not able to direct user to my blog section without login?
- How to redirect all page requests to a single “goodbye” homepage? [duplicate]
- Redirecting simple big problem
- Date based redirects of posts that no longer exist
- Add new post redirection [closed]
- How to Redirect WordPress domain.com/?anyword to 404 Page?
- How to redirect a child page to its parent page?
- WordPress multi domain: page redirect to main domain whenever WordPress do the URL guessing issue
- Applying ‘middleware’ to a url before redirecting? Does WP have built in mechanism for this?
- How can I prevent caching of wp_redirect?
- Add base folder to CPT and 301
- How do redirect user back to previous page when on certain pages?
- Keep the old referrer after failed login
- Re-Direct ALL Users to the Home Page IF not logged in
- How to redirect if 404 error in wordpress then redirect 404.php url
- Redirect to dashboard user once you click on Publish page
- ERR_TOO_MANY_REDIRECTS when switching from good database to old database
- Redirect to /404/
- Redirect Category Media ‘URL’ when clicked
- How to automatically redirect category pages (301) when changing the location of a category in the hierarchy
- wordpress automatic URL ‘page’ parameter rewrite
- How to 301 redirect sub domain post URL to root domain
- Why https://www. SUBdomain is redirected by WP to https://MAINdomain
- redirect to another page if user has registered successfully
- redirect after account activation for forum using bbpress and buddypress
- using wp_rewrite but keep the original url in the address bar
- One set of Child Pages redirecting to Home page?
- How to redirect 404s that generated for css&JS files?
- Redirect after empty register form
- Redirect to a subdirectory frontpage using without using a WP plugin- what files to edit, and how?
- How do make WordPress to let alone my static home page?
- problem redirecting users to page on login
- Create a 301 Redirect automatically when adding %category% in the permalink
- Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error
- How to disable login and registration pages?
- Post Migration Site Migration Redirects All Known Solutions Attempted
- wp_redirect() doesn’t work