Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Create a full list of sites with domain mapping with wp-cli
for i in `wp site list | cut -f 2 | grep -v url`; do wp --url=$i eval 'global $wpdb, $blog_id; $blogname=get_option("blogname"); $blogurl=home_url(); $domains=$wpdb->get_results( "SELECT * FROM {$wpdb->dmtable} WHERE blog_id = $blog_id;" ); foreach( $domains as $data ) { echo $blog_id.",".$blogname.",".$blogurl.",".$data->domain.",".$data->active."\n"; }'; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment