I wouldn’t recommend to use update_option
for this task. Why? Because themes/plugins may use switch_theme
action and it won’t get run in such case. And this action is pretty important – it will allow you to save your widgets for example…
Another problem with Fuxias answer is that she uses template_directory
hook. But there is no point to run it every time. If you set the theme, it is set, so you have to do it only once.
Here’s the code that will loop through all subsites and set the theme to given one. Put it on your site, run once and then delete it (or comment it):
function switch_all_multisite_themes() {
foreach ( get_sites() as $site ) {
switch_to_blog( $site->blog_id );
switch_theme( 'twentyeleven' );
restore_current_blog();
}
}
switch_all_multisite_themes(); // run this function only once
Related Posts:
- Bulk activate a theme on multisite
- Allow user to select a theme to install when they signup
- Changing Multisite themes on mass
- Is there an easy way to separate themes on network?
- Hide a theme on list of themes in wp-admin without editing core files
- Can I install a theme on only one site of a multi-site network install?
- Can’t find “Add New” button for themes in a multisite
- How to move theme directory but not plugins/uploads out of WordPress root directory?
- Manipulate list of themes in wp-admin
- Subfolder multisite issue. Themes and plugin files 404
- cant enable theme in multisite
- Using Two Themes – One for Main Site, One for Ecommerce
- Multi-site get_bloginfo(‘stylesheet_directory’) referring to sub-folder
- Multisite theme control not working
- WordPress MultiSite Theme
- Update configured themes
- How to show different sub sites based on Member’s user name In word press?
- Does a single theme license work on multisite? [closed]
- Create a CSS file in plugin folder when theme is activated
- Is it necessary to network enable both the parent and child theme for multisite installations?
- Trying to change active theme on all sites in Multisite
- Multisite > Edit Site > Themes – what are these themes?
- WordPress multisite with same content
- How to automate setup of theme, pages, widgets, etc for a new site in multi-site?
- Why WordPress w/ Nginx Multisite Only Lets Admin Upload ZIP Plugins But Not Themes? [closed]
- May I do multiple micro-sites with different themes in a single wordpress without subdirectory nor subdomain separation?
- How can I have two or more WordPress Pro (paid) themes that form a single website?
- Create link preview for theme wordpress
- Themes are visible in Network, but invisible in sites
- WordPress theme to support single website but with 3 sections for 3 languages
- WordPress multisite condition for certain blog_id’s
- WordPress Multisite – Auto enable theme
- Whats the best Practice for using a different Theme for WebView Apps?
- Creating a stand-alone site from a WordPress sub site
- Updating themes customized by users
- How to handle responsive and non responsive websites in one WordPress Theme?
- In a MS install, can you allow different users to have their own themes?
- Iterating over every multisite / theme and list the pages
- different image for mobile template block theme
- How to migrate subsite from dev multisite to production multisite
- WordPress Multisite allow site admin to add user without email confirmation
- Wildcard subdomain for the same site
- Is there a filter to define the OG image on a given post?
- How to reset passwords for all users on a network using wp cli
- WordPress Multisite with NGINX, subfolders, and FROM a subfolder
- How to consolidate all sitemaps in a multisite network?
- How to modify author base slug with groups and slug to use nice_nickname?
- Multisite installation combining subdomains and subdirectories
- How to find site id for one site on a multisite
- Stop wordpress from sending out moderation emails
- BP Multi Network & Members Directory [closed]
- Need to manually regsiter user, send the password and retreive their user ID
- Deleting sites and users automatically in multisite
- Make default new sites https (multisite)
- Sharing Header Components Across Multisite
- How to get a user role of a specific blog in multisite?
- Logout issue with new Domain on WP Multisite
- Subdomain and subdirectories together in one installation
- WordPress Installation for multi-domains with nginx and php-fpm
- Get users primary blog URL in MultiSite
- Is it possible to setup multiple sites with a common pool of posts?
- Not able to access dashboard of subdomain
- Multisites, upload issues, and iOS!
- Multisite new sites not found(404), main site still works [closed]
- How to get option values set from all sites within a Multisite setup?
- How to host blog on separate domain from main site
- What is meant by Multisite in WordPress?
- Allow Author on Site A capability to upload files on Site B in Multi Site
- How to use a Wildcard SSL with WordPress Network?
- Migrating wordpress multisite and domain mapping plugin
- WordPress Multisite – Can 2 domains share a database of users?
- Can you create a local wordpress network / multisite install on a mac with subdomains?
- How to solve this issue
- What is the way to share data between sites in a multisite
- ERR_TOO_MANY_REDIRECTS when i config my subdomains
- Subsite access without being a member of the subsite in wp multisite network
- Redirect loop after activating wordpress multisite feature
- Development of new theme and rollout on multisite
- Is it possible for a child-site of a multisite to be a multisite itself?
- How to show only blog-domain instead of the whole permalink in the loop
- Multisite installation on an existing single installation
- Multiple subsites in a single wordpress installation
- How to sync roles across Multisite?
- WordPress Multisites or Multiple WP Single sites?
- $_SERVER[‘SERVER_NAME’] in WP_SITEURL
- Two installs conflicting – Pages redirecting
- WP-Cli Error When Mapping Multisite Subdomain
- WP Multisite Sub-Domain Error
- WordPress Network with SSL for multiple domains
- Nginx rules for subdomain multisite install (Bedrock)
- WP Admin Panel for Multi-site install not loading JavaScript for one Subdomain
- multisite detect subsite blog number
- How to Create WPMu New User?
- Is it possible to create a login for restricted visibility?
- multi-language multi-site with REST API
- How to make Multisite global login that redirects to correct subsite after login
- Advice on WP site structure using multisite
- FromName –> ReplyTo Name wordpress multisite contact form
- Using WordPress multisite is there a way to force HTTPS on specific subsites and not others?
- WordPress Multisite Network – Site Administrators Can’t Access wp-admin