Title: A question about WP-CLI command.
Last modified: February 2, 2021

---

# A question about WP-CLI command.

 *  [hack3rcon](https://wordpress.org/support/users/hack3rcon/)
 * (@hack3rcon)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/)
 * Hello,
    Can I set a password for the WordPress admin page or change the URL of
   it?
 * Thank you.
    -  This topic was modified 5 years, 3 months ago by [hack3rcon](https://wordpress.org/support/users/hack3rcon/).

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

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-13993251)
 * You can do [https://developer.wordpress.org/cli/commands/user/reset-password/](https://developer.wordpress.org/cli/commands/user/reset-password/)
 * And, [https://wordpress.org/support/article/changing-the-site-url/#wp-cli](https://wordpress.org/support/article/changing-the-site-url/#wp-cli)
 *  Thread Starter [hack3rcon](https://wordpress.org/support/users/hack3rcon/)
 * (@hack3rcon)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14014920)
 * Thank you, but I meant was set a password for see the WordPress admin page. For
   example, when I browse “[https://mywebsite.com/wp-admin](https://mywebsite.com/wp-admin)”
   then it ask me a username and password then show the admin page.
    About the second
   question, can I change “[https://mywebsite.com/wp-admin](https://mywebsite.com/wp-admin)”
   to “[https://mywebsite.com/wproot](https://mywebsite.com/wproot) ” or…?
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14015780)
 * > For example, when I browse “https://mywebsite.com/wp-admin ” then it ask me
   > a username and password then show the admin page.
 * WordPress already operates that way. If you visit /wp-admin/ but aren’t logged
   in yet, you’re sent to wp-login.php where it asks for your username and password.
 * > can I change “https://mywebsite.com/wp-admin ” to “https://mywebsite.com/wproot
 * No, that cannot be done via WP-CLI.
 *  Thread Starter [hack3rcon](https://wordpress.org/support/users/hack3rcon/)
 * (@hack3rcon)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14018549)
 * Thanks, but I must explain more.
    I know that for logging to the WordPress admin
   dashboard, I must enter the username and password, but I meant was set a password
   for seeing that page. Something like: [PhpMyAdmin](https://www.tecmint.com/phpmyadmin-login-password-protection-htaccess/)
   Set a username and password for the Login Interface.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14021109)
 * That’s HTTP Authentication, not something controlled by WordPress, so it can’t
   be set by WP-CLI.
 *  Thread Starter [hack3rcon](https://wordpress.org/support/users/hack3rcon/)
 * (@hack3rcon)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14025628)
 * Thank you.
    Thus, it must handle by Apache? If yes, then how can I change below
   lines to set a password for WordPress logging page?
 *     ```
       <Directory /usr/share/phpmyadmin>
           AuthType Basic
           AuthName "Restricted Content"
           AuthUserFile /etc/httpd/.htpasswd
           Require valid-user
       </Directory
       ```
   
 * >
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14026181)
 * Try this: [https://wordpress.org/support/article/htaccess/#password-protect-login](https://wordpress.org/support/article/htaccess/#password-protect-login)
 *  Thread Starter [hack3rcon](https://wordpress.org/support/users/hack3rcon/)
 * (@hack3rcon)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14031838)
 * Thank you so much.
    I am already using “htpasswd” for protecting “PhpMyAdmin”,
   Can I have two different “htpasswd” file? One for PhpMyAdmin and another for 
   WordPress. For “PhpMyAdmin” I did: `# htpasswd -c /etc/httpd/.htpasswd "Panel
   User"` Then, create the “.htaccess” file within the “PhpMyAdmin” directory with
   below lines:
 *     ```
       AuthType basic
       AuthName "Authentication Required"
       AuthUserFile /etc/httpd/.htpasswd
       Require valid-user
       ```
   
 * For WordPress can I use “.htpasswd2”?
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14032326)
 * You can use the same file or delete a new file. `AuthUserFile` is where you’ll
   do that.
 *  Thread Starter [hack3rcon](https://wordpress.org/support/users/hack3rcon/)
 * (@hack3rcon)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14035279)
 * Thank you.
    I added another file with below command: `# htpasswd -c /etc/httpd/.
   WPhtpasswd "Panel User"` In the root directory of the WordPress, a “.htpasswd”
   file existed and added below lines at the end of it:
 *     ```
       AuthType Digest
       AuthName "Password Protected"
       AuthDigestDomain /wp-login.php https://www.MyWebSite.com/wp-login.php
       AuthUserFile /etc/httpd/.WPhtpasswd
       Require valid-user
       Satisfy All
       ```
   
 * Then restarted the Apache service and when I browse the WordPress admin dashboard,
   then it asks me the username and password, but it doesn’t work!!!
    Can it because
   that I used the same username in “Panel User” for the phpMyAdmin and WordPress?
 *  Thread Starter [hack3rcon](https://wordpress.org/support/users/hack3rcon/)
 * (@hack3rcon)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14047000)
 * Hello,
    I added above lines, but it asks me the username and password for visit
   the website and not just “wp-login.php”. How can I solve it? I guess that I shouldn’t
   add the above lines in the “.htpasswd” file under the WordPress directory!!!

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

The topic ‘A question about WP-CLI command.’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 11 replies
 * 2 participants
 * Last reply from: [hack3rcon](https://wordpress.org/support/users/hack3rcon/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/a-question-about-wp-cli/#post-14047000)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
