Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8036485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:38:11+00:00 2026-06-05T02:38:11+00:00

I’m working on a WordPress site which has various features that are only available

  • 0

I’m working on a WordPress site which has various features that are only available to registered users. I need to prompt the users to register/login at various places, and after they do I want to return them to the original page they were on.

I know how to do this manually, but my suspicion is that there is a way to take advantage of built-in WordPress functions, so I’d rather not “reinvent the wheel.” I’ve searched for solutions but I’ve only found strategies that involve a hard-coded, static return page after registration. I DON’T want to do this. I’m looking for a way to keep track of the referring page, and return to it after registration. Thanks in advance.

EDIT1: I’ve located what I thought I was looking for, which is the filter hook login_redirect. It appears to be designed for exactly what I want to do, but I don’t seem to be able to get it to work.

The implementation should be pretty straight-forward, so I’m not sure what I could be doing wrong. Here’s the code in my theme’s functions.php:

function redirect_to_function($redirect_to, $request, $user)
{
return 'http://www.mywebsite.com/redirect_page/';

}
add_filter( 'login_redirect', 'redirect_to_function', 10, 3 );

EDIT2:
I think I solved the mystery as to why the redirect_to filter isn’t working, as well as the solution using the hidden field named “redirect_to” (see comments below). I’m using the s2Member plugin to manage membership levels, and I suspect that it is overriding the built-in wordpress functionality.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:38:13+00:00Added an answer on June 5, 2026 at 2:38 am

    My problem was related to a specific plugin I was using that was over-riding my hooks. See my edits above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I need to clean up various Word 'smart' characters in user input, including but
I need a function that will clean a strings' special characters. I do NOT
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

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.