Do you want to redirect the user to login to your WordPress site to a specific page or Home Page?
Then you land at the right place.
Here:
We have posted custom written functions that will easily help you to redirect users to the page you desire after login.
Redirect User To login WordPress
To redirect the user to Homepage or specific page, we have written 2 custom functions.
Have a look at them:
WordPress Login Redirect to Homepage
Just copy the below-embedded code and paste it into your WordPress theme’s functions.php file.
Code Snippets After Login Redirect to HomePage.
After that:
Save the file and try to log in and check whether it is working or not.
WordPress Login Redirect to Specific Page
To redirect to the Specific page, we need to
First of all, copy the below code then paste it into your WordPress functions.php file…
…and give the page slug name in the place of to 'blog'
where you want to users redirect after successful login.
Code to Redirect users to Specific Page.
That’s it.
Video Guide: WordPres Login Redirect
Hope this guide helped you, Let us know in the comment box.
Don’t forget to share this WordPress Login Redirect guide.
Redirect ads are the ones that really annoy me. Pop-ups show up in a different window, thus when you close them, you can go back to what you were doing. Redirects make you go somewhere else, so not only does it interrupt you, but you have to spam the back button a lot to get past all the redirect prompts. And then it goes and reloads the redirect stuff agin a few seconds later.
not works
first of all, an editor on clicking update, it says main theme file can’t be edited
ongoing theme website as per his instruction to make a child theme and do whatever you want.
i had tried all the method but the change not reflecting on website
So you made the child theme and inside of that child theme’s function.php you have added those above code and not success?
Can you provide me code snippets of your functions.php file.
And one more thing.
Is your child theme activated and connected to its parent theme?
Thank you! I am French-speaking so I could not understand the video, but I have all the information I need on the text. I will give it a try…
I have a question. I’ve installed a French version of WordPress. So the role of “Administrator” for example is written “Administrateur” . What do I write in the function : “administrator” or “administrateur” ?
Thank you
Mimi
Mimi, thats great question.
It is hard for me to tell you which function you should write “administrator” or “administrateur”.
So do 2 things.
1: Use each one and try the page is redirecting or not. If it is not redirecting then, it is not working. but if it is redirecting, then you know it is working.
2: get all roles
$all_roles = $wp_roles->roles
and either print_r it or loop it with foreach, so you will get the list of all roles that are available in your french version with its name.Hope it will help you.
Thanks Mimi for comment.
Thank you so much for your quick answer. I am new to WordPress, and I have a stupid question. Where the heck is “functions.php” located ? 🙂
Thank you !
Mimi