How to set “Site Address (URL)” programmatically on WP multisite?
If you just want to update that one value, then you can use wp_update_site(): wp_update_site( 123, [ ‘domain’ => ‘new-slug.domain.com’, ] ); But to really update the site URL/address, you’d need to update both the siteurl and home options for the site: switch_to_blog( 123 ); update_option( ‘siteurl’, ‘new URL here’ ); update_option( ‘home’, ‘new URL … Read more