How to Move Local Singlesite Database to Remote Multsite Database?

Merging WordPress Standalone Installation with WordPress Multisite Installation Before You Begin: Create a new site in your Multisite Network, which will be the site you’re migrating from the Standalone installation. (Take note of the site ID #, you’ll need it later.) You need to make sure that all of the users from the Standalone installation, … Read more

Rewrite Custom Post Type URL slug

If the city and region is always city and region strings, you can do something like this. For your specific case, you could do it like this: ‘rewrite’ => array( ‘slug’ => ‘city/region/event’ ), ‘hierarchical’ => true, ‘has_archive’ => false, ‘supports’ => array( ‘title’, ‘editor’, ‘thumbnail’, ‘page-attributes’), If the city becomes some city and the … Read more

Custom column under All Users (multisite network admin)?

This is all you need to add a column to the network users table, put it before a chosen column, and add data to it. add_filter( ‘wpmu_users_columns’, ‘my_awesome_new_column’ ); add_action( ‘manage_users_custom_column’, ‘my_awesome_column_data’, 10, 3 ); // Creates a new column in the network users table and puts it before a chosen column function my_awesome_new_column( $columns … Read more

Get users primary blog URL in MultiSite

There’s actually a function for that: get_active_blog_for_user() https://developer.wordpress.org/reference/functions/get_active_blog_for_user/ $user_id = get_current_user_id(); $user_blog = get_active_blog_for_user( $user_id ); echo $user_blog->siteurl;

WP-CLI can’t list posts

(I’ll post here @photocurio’s answer, as it’s hidden in the comments) wp post list –post_type=page # will show only post-type=page wp post list # will show only post-type=post It’s counter-intuitive command is also mis-documented, (which I hope to change), because: pages are posts. There’s no “wp page list” command. The docs don’t mention that the … Read more