This topic has 10 replies, 3 voices, and was last updated 7 years by Roader.

  • Author
  • #147771
     Roader
    Participant

    Hi there!

    In spanish:

    Laura, cómo puedo restringir el acceso a wp-admin o wp-login?

    Por ejemplo, si yo pongo seventhqueen.com/wp-admin , aunque esté logueado en My Account, no me da acceso al DashBoard ni siquiera como Suscriptor.

    Sin embargo, usando el usuario de prueba si pongo misitio.com/wp-admin,  estándo logueado como Suscriptor, me abre el DashBoard y yo no quiero eso.

    De hecho, lo que quiero es cambiar wp-admin y wp-login por cualquier otro. wp-banana p. ej. Pero he fallado en conseguirlo.

     

     

    Attachments:
    You must be logged in to view attached files.
    #147845
     Laura
    Moderator

    Hola, quiza esto ayude https://codecanyon.net/item/hide-my-wp-amazing-security-plugin-for-wordpress/4177158 es un plugin muy bueno para la seguridad de la web, eso si, ten mucho cuidado con las opciones y haz copias de seguridad si lo usas 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #148145
     Roader
    Participant

    Ummm I prefer php code… 😀

    #148278
     Laura
    Moderator

    PHP es mucho mas complicado que usar un plugin especialmente diseñado para eso.
    Si prefieres php te recomiendo contratar a un desarrollador que lo haga por ti.
    El foro esta para resolver problemas relacionados con el tema, no podemos ofrecer soportes para pedidos o caracteristicas adicionales

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #148313
     Roader
    Participant

    Mi querida Laura. Los plugins necesitan soporte, un código PHP estable no.

    Tampoco hay necesidad de contratar, ya que solo necesito leer y aplicar.

    Lo que quiero saber es cómo uds aseguraron el Wp-Login, pues veo que lo tienen protegido en el Demo.

    Yo sé como protegerlo, el problema es que quizás hay algo que me falta y por eso me da error cuando uno hace click en Log Out. En el Demo permite hacer Log Out sin pedir confirmación de la Clave protectora.

    #148513
     Laura
    Moderator

    Hola, si puedes escribirlo en inglés se lo asignaré a radu 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #148518
     Roader
    Participant

    Ok, más tarde. Pero lo que digo es que ya uds tienen la forma de aplicar protección al Login sin que esta afecte el LogOut de los Suscriptores. Eso es lo que quiero saber.

    Por otro lado qué me dices del Plugin AIO Wp Security and Firewall?

    #148720
     Radu
    Moderator

    I don’t understand Spanish but related to the topic title, this is the solution for what you need: https://wordpress.org/plugins/remove-dashboard-access-for-non-admins/

    No quick solution PHP snippets !

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #151292
     Roader
    Participant

    Laura, a partial solution is:

    In functions.php:

    COPY CODE
    // Restrict WP Dashboard 
    add_action( 'init', 'blockusers_init' );
    function blockusers_init() {
     if ( is_admin() && !current_user_can( 'administrator' ) && !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
     wp_redirect( home_url() );
     exit;
     }
    }

    In .htaccess (fist line only)
    // Change wp-login to your custom url
    RewriteRule ^your-custom-login-name$ http://your-domain.com/wp-login.php [NC,L,R]

    #151293
     Roader
    Participant

    Other solution is:

    An .htaccess in wp-admin folder:

    COPY CODE
    # Protect wp-admin by my IP
    order deny,allow
    allow from 0000000000 #Change it for your IP
    deny from all
     
    <Files admin-ajax.php>
      Order Allow,Deny
      Allow from All
      Satisfy Any
    </Files>

    ————————

    But, there are some problems…
    Radu. I found this code ===> But, does not work. :-/
    I dont know if is Sweetdate Registration Form or BuddyPress… The problem is, that you can Register with whatever Email, i.e. mydog@mydogisbig.com

    And, there is not a button of field to Resend the Email Confirmation, after you complete.

    COPY CODE
    // Restrict WordPress Registration to Email Whitelist
    function is_valid_email_domain($login, $email, $errors ){
     $valid_email_domains = array("yahoo.com","hotmail.com","outlook.com","gmail.com","aol.com","mail.com");;// whitelist email domain lists
     $valid = false;
     foreach( $valid_email_domains as $d ){
     $d_length = strlen( $d );
     $current_email_domain = strtolower( substr( $email, -($d_length), $d_length));
     if( $current_email_domain == strtolower($d) ){
     $valid = true;
     break;
     }
     }
     // if invalid, return error message
     if( $valid === false ){
     $errors->add('domain_whitelist_error',__( '<strong>ERROR</strong>: you can only register using @gmail.com or @outlook.com emails' ));
     }
    }
    add_action('register_post', 'is_valid_email_domain',10,3 );
    #151294
     Roader
    Participant

    Does Not Work (with this Registration Form): Force User to use Strong Passwd (function of WordFence). :-/

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?