Skip to content
  • Log In
  • Register
WordPress.org
  • News
  • Download & Extend
    • Get WordPress
    • Themes
    • Patterns
    • Plugins
    • Mobile
    • Hosting
    • Openverse ↗︎
  • Learn
    • Learn WordPress
    • Documentation
    • Forums
    • Developers
    • WordPress.tv ↗︎
  • Community
    • Make WordPress
    • Photo Directory
    • Five for the Future
    • WordCamp ↗︎
    • Meetups ↗︎
    • Job Board ↗︎
  • About
    • About WordPress
    • Showcase
    • Enterprise
    • Gutenberg ↗︎
    • WordPress Swag Store ↗︎
  • Get WordPress
Get WordPress

Developer Resources

Browse: Home / Reference / Hooks / registration_redirect

apply_filters( 'registration_redirect', string $registration_redirect, int|WP_Error $errors )

Filters the registration redirect URL.

Contents

  • Parameters
  • More Information
  • Source
  • Changelog
  • User Contributed Notes

Parameters

$registration_redirect string
The redirect destination URL.
$errors int|WP_Error
User id if registration was successful, WP_Error object otherwise.

Top ↑

More Information

  • The registration redirect filter is used to change the location redirected to after a user registers. This could be the location set by the “redirect_to” parameter sent to the registration page.
  • This filter is to redirect the user following registration. To filter the location of the registration page itself, use register_url.

Top ↑

Source

File: wp-login.php. View all references

$redirect_to = apply_filters( 'registration_redirect', $registration_redirect, $errors );

View on Trac View on GitHub


Top ↑

Changelog

Changelog
Version Description
5.9.0 Added the $errors parameter.
3.0.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    You must log in to vote on the helpfulness of this noteVote results for this note: -1You must log in to vote on the helpfulness of this note
    Contributed by Niels Lange — 7 years ago

    Examples

    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();
    }
    Log in to add feedback
  2. Skip to note 2 content
    You must log in to vote on the helpfulness of this noteVote results for this note: -1You must log in to vote on the helpfulness of this note
    Contributed by Steven Lin — 3 years ago

    Example Migrated from Codex:

    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();
    }
    Log in to add feedback

You must log in before being able to contribute a note or feedback.

  • About
  • News
  • Hosting
  • Donate
  • Swag
  • Documentation
  • Developers
  • Get Involved
  • Learn
  • Showcase
  • Plugins
  • Themes
  • Patterns
  • WordCamp
  • WordPress.TV
  • BuddyPress
  • bbPress
  • WordPress.com
  • Matt
  • Privacy
  • Public Code
WordPress.org
WordPress.org
  • Visit our Facebook page
  • Visit our Twitter account
  • Visit our Instagram account
  • Visit our LinkedIn account
  • Visit our YouTube channel
Code is Poetry

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.