[wp-trac] [WordPress Trac] #60029: Admin unable to create new Application Password for user with no role on main site (multisite)

WordPress Trac noreply at wordpress.org
Wed Apr 2 12:36:57 UTC 2025


#60029: Admin unable to create new Application Password for user with no role on
main site (multisite)
--------------------------------------+------------------------------
 Reporter:  roytanck                  |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Application Passwords     |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+------------------------------

Comment (by sonaliprajapati):

 **Steps to Fix:**
 Method . 1
 step.1 Temporarily Assign a Role on the Main Site:

 Go to Network Admin > Sites.

 Select the main site.

 Navigate to the Users tab.

 Add the user to the main site (e.g., assign them the "Subscriber" role).

 **step.2 Generate the Application Password:
 **
 Go to Network Admin > Users.

 Edit the user and generate an Application Password.

 Copy the generated password.

 **Step.3 Remove the Role (Optional):
 **
 If the user does not need access to the main site, remove them from it
 after generating the password.

 **Method . 2 Alternative Solution via Code**

 If you want to avoid assigning roles manually, you can use a filter to
 allow users without a role to generate Application Passwords.

 Add this to your mu-plugins or theme’s functions.php:

 {{{#!php
 <?php
 add_filter( 'wp_is_application_passwords_available_for_user', function(
 $available, $user ) {
     return true; // Force enable application passwords for all users.
 }, 10, 2 );
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60029#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list