Is it possible to create two different wp-admins for a wp website

admin2025-06-03  3

I just wanted to know whether it's possible or not to create a website for example newwebsite and create two wp-admins each with different URLs for example one with newwebsite/wp-admin and one as newwebsite/dashboard or something like that or will I need to have another sub domain registered for that.

My Aim - What my is actually is that I wanted to create a website where other users could do certain things on my website like writing posts but and creating projects and showing them on my website for which they would be using the newwebsite/dashboard.

I just wanted to know whether it's possible or not to create a website for example newwebsite and create two wp-admins each with different URLs for example one with newwebsite/wp-admin and one as newwebsite/dashboard or something like that or will I need to have another sub domain registered for that.

My Aim - What my is actually is that I wanted to create a website where other users could do certain things on my website like writing posts but and creating projects and showing them on my website for which they would be using the newwebsite/dashboard.

Share Improve this question edited Feb 6, 2019 at 15:44 fuxia 107k39 gold badges255 silver badges461 bronze badges asked Feb 6, 2019 at 14:30 Milan MuhammedMilan Muhammed 11 bronze badge 3
  • 1 OK... And why should that be another dashboard? Why can't they use the same wp-admin as you? – Krzysiek Dróżdż Commented Feb 6, 2019 at 15:55
  • Look into user roles. Allow certain capabilities to specific roles and deny others. – jdm2112 Commented Feb 6, 2019 at 16:13
  • I wanted to know whether I could just build a custom dashboard for my clients and a dashboard for admin too. – Milan Muhammed Commented Feb 7, 2019 at 2:56
Add a comment  | 

1 Answer 1

Reset to default 2

While it looks like what you're trying to do could be accomplished with user roles (and add_cap() if you're looking to be more specific with roles), if you still really want to make a different dashboard, you can build one.

I recently built a site that was has a custom dashboard for the end users. It can provide a great user experience, but it takes a lot of work to get going.

To get you started, you would need to redirect non-admins away from the wp_admin by adding this to your functions.php

if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
    wp_redirect( home_url() . '/wp-login.php' );
    exit;
};

And a similar redirect function on whatever page you are using for your dashboard

if (!(is_user_logged_in())){
    wp_redirect( home_url()  . '/wp-login.php'  );
    exit;
};

That way, anyone with a login can access "/dashboard', but only admins can access '/wp-admin'.

If this is the road you're looking to take, you should understand that it can take weeks to months of development to get a consumer ready dashboard built out.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748937726a314978.html

最新回复(0)