Custom Page – How to Take Keep a User for Longer Time

When it comes to e-commerce, there is an unspoken law that states you should design the store in such a way that encourages customers to spend more time there (for example, through a custom page). They need to spend some time on either making purchases or looking around on your website. One of these conditions is that the user must be redirected once they log in.

Custom Page - How to Take Keep a User for Longer Time

Both WordPress and WooCommerce websites need to have an important feature that allows users to be redirected once they have logged in. It does this for eCommerce shops by sending people directly to the shop page or to a page showcasing special discounts (coupons), which helps improve sales.

Not only does it improve the overall experience for the customer, but it also makes it more likely that they will come across things that they would like purchasing. If you do not set up a user registration redirect after login to a custom page, visitors may wind up viewing the back-end of your site. This may be avoided by setting up the redirect in advance. resulting in a negative experience for the client in the end.

Therefore, we will discuss how to redirect users once they have successfully logged in to your WordPress site in today’s lesson. We will demonstrate two different ways:

  • Utilizing one’s own unique code
  • Using a plugin.

Let’s get started with the tutorial right now.

You may also like: How to Draw Free Traffic to Your Website in The Year 2022

After Successful Login, Users Will Be Redirected to a Custom Page

Because WordPress is open-source software, you are able to employ custom code to make any necessary adjustments to your installation.

Therefore, before we demonstrate how to utilize a plugin, we will walk you through the process of writing code in order to accomplish the task at hand.

Method 1: redirect users by using custom code.

The following would be your steps:

  • Create a Child Theme as the First Step
  • The second step is to paste the code into the Function.PHP File of the child theme
  • The third step is to save the code, and then test it by logging in as a customer.

Create a child theme as the first step

It is generally recommended that you utilize your child theme if you are making any kind of adjustments to your site. When you update the plugins in this method, none of your data will be lost in the process.

You may also discover plugins that will allow you to create a child theme.

The second step is to copy and paste the code into the Function.PHP File of the child theme

Now, open up the function.php file for your child theme, and paste the following code into it:

function ts_redirect_login( $redirect, $user ) {

$redirect_page_id = url_to_postid( $redirect );

$checkout_page_id = wc_get_page_id( ‘checkout’ );

if( $redirect_page_id == $checkout_page_id ) {return $redirect;}

return wc_get_page_permalink( ‘shop’ );}

add_filter( ‘woocommerce_login_redirect’, ‘ts_redirect_login’ );

Step 3: Save the Code and Test by Logging in As a Customer

You are done. After that, be sure to save the code and then reload your page. You may verify that the modification is working properly by checking in as a guest user and seeing whether or not you are taken to the store page after doing so.

However, in the event that a consumer attempts to log in while on the checkout page, this code will not work. Because it may be detrimental to your business, the customer’s shopping experience if, after signing in on the checkout page, they are then taken to the store page to complete their purchase.

Method 2: Redirect Users Making Use Of A Plugin Within WordPress

However, if the code appears to be overly intricate and you do not like to engage in any alterations, you always have the option of employing the usage of a plugin in order to get the job done. After successfully logging in, visitors may be sent to a page of your choosing by using the WP User Frontend plugin, which is accessible via the login page.

First, a rundown of the procedures:

  • The first thing you need to do is install the WP User Frontend Plugin.
  • Step 2: Pick the Page That Will Redirect You, or Any Other Custom Page
  • Step 3: Don’t forget to save the configuration, and have fun!

Installing the WP User Frontend Plugin is the first step.

The first task is not difficult at all. Download the open-source plugin from the WordPress repository and install it. After logging in, your users will be able to redirect to any website they like with the assistance of this plugin. Additionally, this free version is compatible with WooCommerce.

In order to do this, navigate to WP-Admins > Plugins > Add New. In the box marked “search,” type “WP User Frontend.” Install the plugin, and then activate it.

Step 2: Choose either the page that will redirect or any custom page.

Proceed to User Frontend > Settings > Login/Registration when you have done so. Now choose the page that you want people to be taken to after they have successfully registered with your website. The dropdown menu contains links to each and every page on this website. Choose the one you want, and then click the Save button.

Step 3: Don’t forget to save your configuration and have fun!

After you have finished choosing your options, click the Save button, and the users of your site will be taken to the page you have chosen.

After successfully logging in, customers of your WooCommerce store can be redirected in the following manner.

Elevate the quality of the user experience by immediately configuring the Login Redirect for WooCommerce!

If you followed the instruction up above, you should now be aware of how to redirect a user once they have logged in. You will have, as a result of the login redirect feature:

Control over every aspect of your pages in its entirety. Through the use of redirect, you can get complete control over the sites that your visitors will see after they have successfully logged in. Because of this, your website has an excellent potential to capitalize on this.

Getting people to go to a specific page by offering them incentives. For instance, if you have a website devoted to discounts, you can simply urge people to go to that page as soon as they have finished logging in.

In a nutshell, it has become more important for WooCommerce businesses to move customers away from the login page and onto a custom page. Therefore, in order to make your WooStore stand out from the competition, you need to likewise keep the trend. In particular, these redirects provide an abundance of benefits for your websites.

How to Import a custom page in XTRA WordPress Theme?

Leave a Comment