📘 Multi-Site Post Publisher – Full Documentation

Plugin Domain: wppluginpilot.com/multisitepostpublisher
Plugin Type: WordPress Multisite
Purpose: Publish posts from the main site to selected subsites in a multisite network

🧩 Introduction

The Multi-Site Post Publisher (MSPP) plugin is a powerful tool for WordPress multisite networks. It enables network administrators to create a post on the main site and push it automatically to one or more subsites, reducing the need to manually copy and paste content into each site. It’s ideal for news networks, franchises, educational organizations, or anyone managing multiple WordPress subsites with similar content requirements.

⚙️ How It Works (Behind the Scenes)

  1. Plugin Initialization:
    When activated network-wide, it hooks into plugins_loaded, initializing the main class and loading:
    • Settings page (class-mspp-settings.php)
    • Post metabox (class-mspp-metabox.php)
    • Publishing logic (class-mspp-publisher.php)
    • Utility functions (class-mspp-functions.php)
  2. Network Settings Page:
    Location: Network Admin → Settings → MSP Publisher
    Admins can:
    • View all available subsites
    • Select publishable targets
    • Save preferences using update_site_option()
  3. Post Edit Screen (Metabox UI):
    Main site only. Metabox titled “Publish to Other Sites” shows selected subsites as checkboxes. Selections are saved as post meta.
  4. Saving and Publishing Logic:
    On save_post, if subsites are selected:
    switch_to_blog( $subsite_id );
    wp_insert_post( $post_data );
    restore_current_blog();
    The following are cloned:
    • Title, content, excerpt, status
    • Featured image (if exists)
    • Post categories (by name)
    Note: Custom post types, fields, and ACF are not supported out of the box.

🛠 Installation Guide

  1. Unzip plugin and upload to /wp-content/plugins/multi-site-post-publisher/
  2. Log in to Network Admin Dashboard
  3. Go to Plugins → Installed Plugins
  4. Click “Network Activate” for the plugin

🧪 Configuration

  1. Navigate to: Network Admin → Settings → MSP Publisher
  2. Select the subsites you want to allow publishing to
  3. Click “Save Changes”

✍️ Usage Guide

  1. In the main site dashboard, create or edit a post
  2. Scroll to “Publish to Other Sites” metabox
  3. Select the subsites
  4. Click “Publish” or “Update”

🧭 Steps to Generate an Application Password on the Target Site

  1. Log in to the target site as an Administrator.
  2. Go to Users → Profile (or "Edit Profile").
  3. Scroll to the Application Passwords section.
  4. Enter a name (e.g., MSPP Main Site) and click “Add New Application Password”.
  5. Copy the generated password immediately – it will not be shown again.

Note: If the Application Password section is missing, ensure the site uses HTTPS and the REST API is enabled.

🏗️ Add External Site in MSPP Plugin

  1. Go to Network Admin → Settings → MSP Publisher.
  2. Scroll to the “Add New Site” section.
  3. Fill out the following fields:
    • Site URL – Full site URL (e.g., https://news.example.com)
    • Username – The WordPress username associated with the Application Password
    • Application Password – The password generated in the previous step
  4. Click “Add Site”.

The site will now appear in the list of publishable destinations.

📌 Important Notes

  • Switch to blog: Uses switch_to_blog()
  • Data Sync: One-time push, not live sync
  • Image Handling: Featured images copied by ID only (may not show if missing)
  • User Permissions: Only super admins or authorized roles can publish
  • Custom Post Types: Not supported
  • Editor Support: Works with Gutenberg & Classic Editor

❓ Troubleshooting

Issue Solution
Posts not showing in subsites Ensure subsite is enabled in plugin settings and you have permissions
Images missing Plugin doesn’t upload images to subsites. Upload manually or use CDN
Categories not assigned Categories matched by name. Missing ones are ignored
Custom fields not copied Use mspp_before_publish and mspp_after_publish hooks

🛡 Security & Performance

  • Uses nonce verification for metabox form
  • Only accessible by super admins or authorized users
  • Uses native WordPress functions — no raw DB queries

🧾 Changelog

  • v1.0.1 - Updated Code
    • Added `wp_localize_script` to pass option name (`mspp_sites`) to JavaScript securely.
    • Removed inline script in settings page for better security and maintainability.
    • Minor code cleanup and comments for better readability.
  • v1.0.0 – Initial Release
    • Multisite publishing
    • Admin settings page
    • Post edit metabox
    • Featured image + categories replication

🧩 Plugin Folder Structure

multi-site-post-publisher/
├── css/
│   └── admin.css
├── js/
│   └── admin.js
├── classes/
│   ├── class-mspp-settings.php
│   ├── class-mspp-metabox.php
│   ├── class-mspp-publisher.php
│   └── class-mspp-functions.php
├── multi-site-post-publisher.php

📞 Support

Visit: https://wppluginpilot.com/multisitepostpublisher
Or email: support@wppluginpilot.com

Contact Support
Please enable JavaScript in your browser to complete this form.