Add sites to specific site groups via CLI

Hey everyone. Is there a way to add sites with the CLI to a specific site group? It surprises me that this isn’t covered in the docs. Is it not possible right now? How long until this parameter can be used? I see it just being another flag in the CLI command… Any chance you can add this soon?

wp mainwp site --add-site --site-url=https://$domain --name=$domain --admin=$admin --group=1

I’ve no experience using this, but in the file mainwp/class/class-mainwp-wp-cli-handle.php I see a mention of the value “groupids”, so you can try --groupids instead of --group.

2 Likes

Hi @hosthuski, @josklever is right. --groupids is correct

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.