CLI: Generate/Get Security Key of child site

Is there any way to programmatically generate or get the Security Key of a child site using wp-cli running under the target site? wp mainwp-child already contains a command to disable password auth, but it still requires one to log into WP-Admin to acquire the key.

Hey @yafarhad

Welcome to the MainWP community!

You can use the built-in WP-CLI command wp option get to fetch any option from the database. In this case, just run:

wp option get mainwp_child_uniqueid

That’ll return the Unique Security ID without needing to log into WP Admin.

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