Topic in WP-CLI

Multisite Database Commands

Last Updated -


WP-cli also has powerful commands for working within Multisite. Here are a few that are helpful for working within the database. One thing to note when working on multisite with wp-cli is you'll always need to pass the url that is currently set at your top level domain in the network. If you are unsure you can find this in wp-config-hosting.php 

Find the constant set for define( 'DOMAIN_CURRENT_SITE', 'sitename.com' );

Search and replace including seialized arrays

wp search-replace --network 'http://old-domain.com' 'http://new-domain.com' --url=old-domain.com

wp cache flush

Update multisite specific tables (Note: Do not use http(s):// for these steps)

wp search-replace old-domain.com new-domain.com wp_site wp_blogs

Related Topics

  • Using WP-CLI Command Line Tools
    All VPS and Enterprise plans come with a powerful command line tool known as wp-cli  For an overview of basic command...

  • WP-CLI Database Commands
    Note: Please use caution when performing commands on the database and always make sure to take a backup first. WP-CL...

  • Multisite Database Commands
    WP-cli also has powerful commands for working within Multisite. Here are a few that are helpful for working within th...

Pagely is the Managed WordPress Hosting Platform designed to exceed the needs of media, business, and Enterprise customers alike. We help the world's biggest brands scale WordPress.

Copyright © 2006-2016 Pagely, Inc. All rights reserved.
Pagely® and WordPress® are registered trademarks.

Pagely
Powered by Zendesk