Articles of multisite

Generate HTTPS Urls in multisite

I have a plugin that allow my users in multisite to generate simple urls like but i want to include the https instead http … echo ‘<div>’; echo ‘<div><input type=”text” class=”url” value=”‘ .get_option(‘home’). ‘/?my_url=’ . $download[“code”] . ‘” onclick=”;” /></div>’; exit(); } I tried echo ‘<div><input type=”text” class=”url” value=”https://’ .get_blogaddress_by_id( $user_info->primary_blog ) . ‘?my_url=’ […]

How many databases do I need?

I have been asked to build another site for someone else. Eventually, I will turn it over to them. I will develop it locally, then take it live, then turn over full control. In the meantime I need a database for WP to interface with. Do I hook the new site into my existing database […]

SQL Query to Get list of all users along with their blogs

How to query for a list of users along with the blogs in which they are member of in a multi site wordpress installation. For example, I need the results as below user domain abc abc ggh I tried the below query, but its not listing all the domains.. SELECT DISTINCT a.user_login, […]

Add access control origin header information across multisite

I want to add the below snippet to my wordpress installation. <?php header(“Access-Control-Allow-Origin: *”);?> I don’t want to add it in every template header as there are many of them and I have 60 networks with 2-3 sites in each network. In what file should I add this snippet so that it has effect across […]

Multisite: Redirect to appropriate domain if subdomain doesn't exist

I have a multisite with domains:,,, etc. where is the “home domain” of the multisite. As of now there is two issues I am trying to solve at the same time. If I try (a subdomain that does not exist) it will redirect to (and i have registration disabled). […]

Changing the language for each individual site in wordpress multisite

I currently have a multisite setup and I currently have two sites, one is English (default) and the other I want it to be French. Since I can’t have a separate config file and separate language folders I need to be able for each language site to use their respective .po file for the front […]

What is the simplest way to disable multisite leaving one of the sites only?

I developed different versions of a wordpress site using multisite. Now I need to use only the second version out of three, that is blog_id=2 which is also pointed to a What is the easiest way to disable multisite while leaving blog_id=2 pointing directly to

WordPress in subdirectory, Multisite using subdomains Nginx

I’m usually running WP on Nginx + PHP-FPM in a sub-directory (similar to Mark Jaquith’s Skeleton) without any issues, all permalinks are working just fine. Now I tried to do this with WordPress Multisite and got some problems. My wp-config.php settings: // Give WordPress it’s own directory define( ‘WP_SITEURL’, ‘http://’ . $_SERVER[‘SERVER_NAME’] . ‘/core’ ); […]

List all sites in multisite

I want to list all sites in the multi site network in alphabetical order? Right now, the code lists by registered date <?php // Query for getting blogs $blogs = $wpdb->get_results( $wpdb->prepare(“SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = ‘1’ AND archived = ‘0’ AND mature = ‘0’ AND spam […]

How To Run Multiple Multi-Site Networks On Same Box

I’m building a multi-site project locally using the VVV Vagrant VM. I setup a sub-domain multisite install with domain mapping and two sub-sites. Everything works fine. This was my sandbox that I used to get started and figure things out. Now I’ve setup a new, exact replica (obviously URLS are different) of that working multi-site […]