Multisite

WordPress Multisite — is a way of WordPress configuration which allows you to create the unlimited amount of sites within a single installation. These websites are going to share the same database but can have separate subdomains or even domains.

Importing Products in Multisites

Recently I was testing my new plugin related to a multisite network of WooCommerce stores and noticed that before doing a product import into one of the stores in a network you first need to do some additional network configuration.

I mean if you just go to a product import and try to upload a CSV file for example, you will definitely get an error like that:

product import error when importing WooCommerce product in a Multisite network
Trying to upload a CSV or TXT import file will cause this error when running a WooCommerce store within a multisite network. The error message can be like on the screenshot “Sorry, you are not allowed to upload this file type” or “Sorry, this file type is not allowed for security reasons”.

Add a Super Admin User in phpMyAdmin

Sometimes when you work with WordPress multisite network you may need to create a super administrator user not from the dashboard, but from the database with the help of SQL queries.

And in this tutorial I am about to show you how. There are actually only two steps we need to do:

How to Check if Plugin is Active in Multisite Network

When it comes to plugins installed on WordPress Multisite network, some of them can be activated either for the whole network or for a specific site of the network only.

Network activated plugin:

network activated plugins within a WordPress multisite network
When you “Network activate” a plugin, it will be automatically active for every site in your network. Yes, it sounds obvious, but just in case.

The same plugin is activated site-specific:

Site-specific plugin activation in WordPress Multisite

It shouldn’t be a problem to understand how it works, the problems could appear when we try to check whether a plugin is network or site-specifically activated in the code.

There are multiple ways to do that and each of them is quite different.

Multisite User Sync

Recently I’ve developed a user syncronisation plugin which allows to share users between multiple WordPress websites and uses REST API. But when I tried to explore what similar plugins are already out there I found a couple of WordPress Multisite user sync plugins.

And in this moment I don’t fully get it what those plugins do, because users within a multisite network are already shared between blogs.

Let’s figure it out in this post.

Multisite Order Sync in WooCommerce

I’ve been talking a lot about WordPress Multisite synchronisation throughout my blog. And also I have multiple plugins for that, for example – if you are looking for a way to sync WooCommerce products, you can check this plugin, only product inventory – this one.

And right now I would like to talk about WooCommerce orders, specifically about a scenario when you want all the order across your Multisite network to appear on a single store and (optionally) to be removed from the original store where this order has been made.

How to Create a Shared Media Library in Multisite Network

Every once in a while I am receiving questions about my Simple Multisite Crossposting plugin whether it works with shared media library plugins or not (yes – it works). And when I decided to test it I figured it out that there are multiple shared media library plugins out there and every one of them works a little bit differently.

The key idea of most of these plugins is to store all the media on one “main” blog and not necessarily it should be the blog with ID = 1. Then some of them use switch_to_blog() function every time you’re working with attachments on subsites, the other ones even create attachments in database linked to original files on all subsites (I assume it could lead to issues by the way).

Most of all I like a switch_to_blog() approach because it seems unharmful, you can even stop using network media library any time, just deactivate the plugin and continue to use your websites as usual.

Multisite Product Sync for WooCommerce

In this tutorial I am going to show you two ways how you can sync your WooCommerce products between stores within a single WordPress multisite network.

Under two ways I mean this:

  1. In code with the help of the woocommerce_update_product action hook, the switch_to_blog() function and CRUD layers (in case we’re working not with a multisite network but with standalone WooCommerce stores, then we need to use REST API, there is a separate tutorial about that).
  2. With the plugin (just install and here we go).

Below is an example of how it can be implemented on your store with my plugin:

WooCommerce multisite product sync
Just select some of the connected WooCommerce stores you would like to sync this specific product with.