Tutorial Shares
  • Home
  • Tutorials
  • Categories
  • My Favorites
  • Terms of Use
  • WordPress
    • Theme Customizations
    • Security
    • Admin Dashboard
  • Magento
  • Code Snippets
  • Servers
  • CSS
  • Dev Tools
  • Hosting
    • Servers
    • Nginx
    • Ubuntu
    • Linux
  • Design
  • PHP

Redirect to Previous Page After WP Login or Register

Jan 30, 2025 by Christine Cardoso in Wordpress Loading 89

To redirect back to the previous page after a WordPress user logs in or registers for a new account, insert get_permalink() in the wp_login_url() function. After filling out the form, you will no longer be redirected to the wordpress dashboard, but to the previous page.

1
<?php echo '<a href="'.wp_login_url(get_permalink()).'" title="Login">Login</a>'; ?>

 

1
<?php echo '<a href="'.wp_registration_url(get_permalink()).'" title="Login">Login</a>'; ?>

 

Share this:

  • Email

Reccomended Resources

  • Premium Wordpress Themes
  • Super Fast Hosting
  • Domain Name Discounts
  • Wordpress Development Company

Recent Posts

  • How to add a third-party JS plugin to Sage
  • Redirect WordPress Dashboard Access for Non-Admins
  • On Scroll Animations on Multiple Divs
  • Rename WordPress Default Post Type
  • WordPress Command Line

Categories

  • Admin Dashboard
  • Bootstrap
  • Categories
  • Code Compressors
  • Code Snippets
  • CSS
  • CSS3
  • Custom Fields
  • Custom Page Templates
  • Custom Queries
  • Design
  • Development Tools
  • Google Maps API
  • HTML
  • Image Optimizers
  • Javascript
  • Jquery
  • Learn to Code
  • Linux
  • Mac OSX
  • Magento
  • Modals
  • MySQL
  • Nginx
  • Open Source
  • PHP
  • Project Management
  • Ruby
  • Ruby on Rails
  • Security
  • SEO
  • Servers
  • Taxonomies
  • Theme Customizations
  • Twitter
  • Ubuntu
  • Uncategorized
  • Wordpress
  • Wordpress Plugins

Tags

301 Redirects admin meta fields archive.php background image Categories Category Archives custom category meta fields Customize WP custom metaboxes Custom Metaboxes and Fields for WordPress custom meta fields Custom Page Template Custom Post Type Archives Custom Post Types custom taxonomy meta fields date hash url li load Magento logo Metafields Nginx page editor Page Templates Pagination parallax Password Protect Permalinks post query arguments Posts 2 Posts Roots Theme server admin sort posts by meta field sysadmin The Events Calendar Plugin Theme Customizations Twitter Bootstrap typography usermod Wordpress Wordpress hacks Wordpress plugins WP Admin Dashboard wp editor WP Favorite Posts

© 2015 Tutorial Shares

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.