June 2, 2021

wordpress network multisite app password invalid user id

I have a Wordpress Multisite set up as a Network. When I try to add an App Password for a user, I'm getting a cryptic Invalid User ID error.

The problem: when on a network setup, the user must be added to all sites. The error was being caused by this check:

if ( is_multisite() && ! is_user_member_of_blog( $user->ID ) ) {

Solution:

  • go to /wp-admin/network/sites.php

  • for every site, go to Users and add the required user

  • as soon as you get it right, the app passwords area will start saying something similar to:

    Application passwords grant access to all 2 blogs in this installation that you have permissions on.

https://wordpress.stackexchange.com/questions/261319/wp-api-v2-returning-invalid-user-id/

1 comment:

Randy Turner said...

This post on effective study habits is so timely! I’m gearing up for finals and the strategies you outlined are both insightful and easy to apply. I’m definitely going to put these into practice!