Multisite – Page 2

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.

How to Get a Post from Another Site in Multisite Network

Let’s assume, that you’re currently working on Site A and you need to get and display a post (or page or a custom post type – doesn’t matter) from Site B of your Multisite network.

How to do that?

Copy Media Files Between Sites Within a Multisite Network

Recently I’ve been working with this functionality in one of my plugins and now I decided to share it with you.

But I always want my tutorials to be more practical, so check what we are going to create:

move images to another website within a WordPress multisite network

The whole tutorial consists of two parts – in the first one I will show you a ready to use function that allows to move media from one site of a multisite network to another, in the second – we will create a custom bulk action for media files.

Publish Posts to Multiple Blogs in WordPress Multisite

There are actually two ways of organising shared content between sites in Multisite Network:

  1. Post to multiple sites at once and then synchronising any changes, I will show show in this tutorial how to do it with code or with a plugin.
  2. Indexing content and then having access to it anytime from any site, my another plugin will help you with that.

Load More Posts with AJAX for WordPress Multisite

delete_blog and deleted_blog hooks are deprecated since WordPress 5.1.0