The wpmu_new_blog
hook is indeed deprecated and shouldn’t be used; however, it works because it runs after the new site has been initialized (see wp_initialize_site()
) which means the database tables for that site has been created and filled with the default options.
So because you are updating the site’s options like default_comment_status
, then you should use the wp_initialize_site
hook and not wp_insert_site
:
add_action( 'wp_initialize_site', 'setup_multisite_action' ); // use this
//add_action( 'wp_insert_site', 'setup_multisite_action' ); // not this
Related Posts:
- How to add Custom Blog Options to new blog setup form?
- Add site options UI in Multisite Sites > Infos page
- Which action hook to update custom field at network/site-info.php in multisite on update site info
- Plugin for editing options on multisite?
- WordPress Multisite: Adding actions to only one site
- WP Multisite: Adding pages on blog creation by default
- differences between behavior get_option vs get_site_option in multisite
- Perform action on WPMU blog deletion
- How To Provide Sub-Blogs Their Own Domain Names?
- Multisite: How to store global options vs. site options?
- How do I share plugin settings across WordPress network?
- Blog Settings import/export in WordPress Network environment
- How to make WordPress use new Upload Path settings in Multisite Setup
- Hook filter to change wp_upload_dir() path in multisite
- What is the correct form action URL for network options pages?
- Using WP CLI to set options in WP Multisite
- Add New Sub Site from the WordPress back end then in sub site options table option_value must be with https
- WPMU Hook for archive or deactivate blog?
- Make default new sites https (multisite)
- How to update_site_option for specific site within network?
- WordPress (+WPMU) Import/Export ALL settings?
- Does WordPress MultiSite use separate MySql databases?
- Hook up MU site creation
- What are Attributes used for in a WordPress Multisite?
- Multisite Network menu links not updating
- How to get option values set from all sites within a Multisite setup?
- Bulk theme settings in wordpress multisite
- What is the function to get options of the parent site of a multisite network?
- wp-config dynamic hostname in WP_HOME and WP_SITEURL
- WordPress Network admin options page: how to store options and where will they be stored?
- ERR_TOO_MANY_REDIRECTS when i config my subdomains
- Register submenu on network menu from the subsite
- Why is MySQL receiving such a large serialized object?
- How do you update a network option value in the DB via a hook
- get_site_option / update_site_option – the main site and sub sites do not share the same storage
- Multisite Equivalent of `register_setting`?
- wp option get blogname –url=my-sub-site.com returning main site option
- Multisite – each site with it’s own set of users
- What could cause wpmu_create_blog to throw “Already Installed” Error on multisite?
- Update siteurl and home in multisite subsites to https
- multisite shared settings
- Multisite and plugins options
- personal_options hook on WordPress multisite
- How to display update message only to admin
- How to set an option for all sites in my Multisite network?
- Unable to change blog language in multisite
- Whats the best Practice for using a different Theme for WebView Apps?
- Current blog is returning ID of 1 instead of users blog ID?
- Multisite /files/ URLs broken after server move
- Authenticate WordPress Site through another WordPress installation?
- WordPressMU: URL change and broken permalinks/links
- Blog switch wpml string translation (multi-site)
- Extended URLs created using multisite feature not loading CSS/JS
- One login for 3 WordPress installations with combined user table doesn’t work
- Migrate site from WordPress multisite to another WordPress multisite
- How To Change the URL of a WordPress Multisite
- Custom Fields as Post Type Options
- Backend freezing on certain pages of a subsite
- WordPress MU with subdomain
- Modifying get_author_posts_url() in Multisite
- Get multisite count without php?
- How do i get custom metabox data from each multisite blog?
- Do “switch_to_blog()” and “restore_current_blog()” re-run the filters?
- Multisite custom rewrite urls
- Multisite login and redirect to users main blog,
- How to create 30 new sites from an export of a master site?
- Is Multisite the RIGHT option for my case?
- Sending SMTP mail using a server with self-signed SSL
- ajax returns -1 in multisite sub domain
- Nested folder paths for WordPress multisite
- Can WordPress Multisite work like a regular site?
- WordPress Multisite redirect loop
- Setting up multisite with NginX
- Multiple domain with one database
- Domain mapping breaks some plugin scripts and css
- Synchronize wordpress site between two different servers
- How to force WP to create a users table in multisite configuration?
- Determine if a Network has any sites created already
- Creating a stand-alone site from a WordPress sub site
- Problem in adding new site on WP multisite
- Multisite authorization error 401
- Multisite read_more link displays URL twice
- Blog broken after changing Site/Home URL
- multisite detect subsite blog number
- Multsite Child site Auto Content
- Multiple devices wordpress website
- How to configure WordPress for multiple blogs without using multisite?
- Multisite subdirectory root not accessible
- Multisite Demo Data for New Site
- New wordpress uploads are broken
- Responsive Wordress Site – Serve different post types to each device
- WordPress and SQL – Update and Insert from another table if column value doesn’t exist
- Multilingual multisite > customisable footer across different sites with widgets?
- Should I use MultiSite for a subdomain based wp site?
- How to find the site ID on a single site and then add new post with “`multipart/form-data” enctype?
- Can’t import posts in multisite
- User registration problem on multisites web
- Using www along with non-www for main domain in multisite installation
- Multisite, different domains, optional subdirectory, and htaccess
- Multisite “Skip Confirmation Email” Log Out Problem