Skip to content

grabwp/grabwp-tenancy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

37 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GrabWP Tenancy

WordPress Multisite Alternative β€” Multi-tenant WordPress with shared MySQL, domain and path routing, and isolated uploads. No Multisite complexity. No per-site server overhead.

🌐 Website & Documentation: grabwp.com

WordPress PHP License WordPress.org


What Is GrabWP Tenancy?

GrabWP Tenancy turns a single WordPress installation into a multi-tenant platform β€” perfect for freelancers, agencies, and SaaS builders who need to host multiple client sites without spinning up separate servers.

  • No WordPress Multisite required β€” avoids network admin complexity and shared-database risks
  • Shared MySQL with tenant prefixes β€” cost-effective isolation, each tenant gets its own table prefix
  • Flexible routing β€” domain-based or path-based (e.g., yoursite.com/site/abc123) with zero DNS changes
  • Isolated uploads β€” each tenant's media is stored in a dedicated directory
  • Lightweight β€” loads before WordPress core hooks for minimal overhead

πŸ“¦ Download & Resources

Resource Link
πŸ“₯ WordPress.org Plugin Directory β€” official distribution
🌐 Documentation grabwp.com β€” complete guides and support
πŸ’¬ Support Forum WordPress.org Forum β€” community help
πŸ› Issues GitHub Issues β€” bug reports
⭐ Reviews Rate on WordPress.org

Core Features (Free)

Feature Details
Shared MySQL Tenant isolation via unique table prefixes ({tenant_id}_)
Separated Uploads Each tenant gets wp-content/grabwp-tenancy/{tenant_id}/uploads/
Domain Routing Map any custom domain to a tenant
Path-Based Routing Host tenants on subdirectories β€” no DNS changes needed
Shared Themes & Plugins All tenants share the same extensions
Tenant Cloning Duplicate any tenant (or mainsite) including DB + files
Admin Interface Full tenant CRUD with list table, edit, delete, clone
Security Controls Hide plugin/theme management, disallow file edits per tenant
One-click Setup Auto-install MU-plugin and wp-config.php loader from admin

πŸš€ Upgrade to Pro

Need complete isolation for your client sites or Wordpress SaaS platform? GrabWP Tenancy Pro takes you from shared infrastructure to per-tenant independence:

Pro-Only Features

Feature Description
Dedicated MySQL or SQLite per tenant Complete data isolation β€” zero cross-tenant risk, no shared tables
Full wp-content separation Each tenant gets isolated themes, plugins and uploads
AJAX Backup & Restore 7-step backup and 8-step restore with real-time progress UI
Cross-database migration Move tenants freely between shared MySQL, dedicated MySQL, and SQLite
Extension sync & management Sync plugins/themes with filesystem; switch between symlink and copy installs
Broken symlink auto-repair One-click detection and repair for broken plugin/theme symlinks
Custom tenant data location Store content anywhere β€” outside wp-content/uploads via settings or wp-config.php
Per-tenant config files Each tenant gets its own wp-config.php; new tenants inherit master defaults

Pricing

From $9.99/month β€” all plans include every Pro feature.
Use code **EARLYBIRDPRO** at checkout for 20% off.

πŸ‘‰ Get GrabWP Tenancy Pro β†’


Requirements

  • WordPress 5.0+ (tested up to 6.9)
  • PHP 7.4+

Quick Start

Installation

From WordPress.org (Recommended)

  1. Go to Plugins > Add New in your WordPress admin
  2. Search for "GrabWP Tenancy"
  3. Click Install Now then Activate
  4. Add to wp-config.php:
require_once __DIR__ . '/wp-content/plugins/grabwp-tenancy/load.php';

The plugin's Status page provides a one-click auto-installer for both the MU-plugin and wp-config.php line.

Manual Installation

  1. Download from WordPress.org Plugin Directory
  2. Upload grabwp-tenancy to /wp-content/plugins/
  3. Activate and follow the Status page setup wizard

πŸ“– Need help? See the complete documentation or the support forum.


Architecture

File Structure

wp-content/
β”œβ”€β”€ grabwp-tenancy/          # Tenant data (outside uploads for security)
β”‚   β”œβ”€β”€ tenants.php          # Domain/path mappings
β”‚   └── {tenant_id}/
β”‚       └── uploads/         # Isolated uploads per tenant
└── plugins/
    └── grabwp-tenancy/      # Base plugin

Database Architecture

  • Shared MySQL with tenant prefixes ({tenant_id}_)
  • Cost-effective isolation β€” no extra databases needed (Pro adds dedicated DB option)

Tenant Structure

$tenant = [
    'id'           => 'abc123',       // 6-char alphanumeric
    'domains'      => [               // Array, primary domain first
        0 => 'client1.example.com',
        1 => 'alias.example.com',
    ],
    'status'       => 'active',       // active | inactive
    'created_date' => 1714000000,
];

Routing

Tenants can be served on custom domains or path-based subdirectories using the nodomain.local placeholder:

$tenant_mappings = [
    'abc123' => ['tenant1.example.com'],
    'def456' => ['nodomain.local'],   // β†’ yoursite.com/site/def456
];
flowchart TD
    A[HTTP Request] --> B[Extract domain or path]
    B --> C[Load tenants.php]
    C --> D[Search tenant mappings]
    D --> E{Found?}
    E -->|Yes| F[Set tenant context]
    E -->|No| G[Use default/main site]
    F --> H[Set DB prefix]
    F --> I[Set content paths]
    G --> J[Continue as main site]
    H --> K[Initialize WordPress]
    I --> K
    J --> K
    K --> L[Process request]
Loading

FAQ

Does this work with WordPress Multisite?
No β€” it's a standalone alternative. It provides multi-tenancy through routing and DB prefixes without Multisite's network admin overhead.

Do I need a custom domain for every tenant?
No. Path-based routing lets you host tenants at yoursite.com/site/{id} with zero DNS changes.

How is this different from WordPress Multisite?
Multisite shares one DB, one plugin set, and one theme set. GrabWP Tenancy gives each tenant separate table prefixes and separate uploads. Pro adds dedicated databases and fully isolated wp-content per tenant β€” something Multisite cannot do.

Can I manage 50+ client sites?
Yes. GrabWP Tenancy is built for agencies and freelancers. Pro adds per-tenant backup/restore for easy management at scale.

Is it compatible with other plugins?
Most plugins work out of the box. Plugins that hardcode DB table names (without $wpdb->prefix) may need configuration.


Development

Project Documentation

The repository docs live in docs/:

  • docs/project-overview-pdr.md - product context and requirements
  • docs/codebase-summary.md - code structure and runtime map
  • docs/code-standards.md - conventions and validation
  • docs/system-architecture.md - bootstrap, routing, data, and clone architecture
  • docs/project-roadmap.md - current status and next milestones
  • docs/deployment-guide.md - setup and release checklist
  • docs/design-guidelines.md - WordPress admin UI guidance

Naming Conventions

  • Functions: grabwp_tenancy_ prefix
  • Classes: GrabWP_Tenancy_ prefix
  • Constants: GRABWP_TENANCY_ prefix

Contributing


Changelog

v1.0.9

  • Fix: Tenant data directory moved to wp-content/grabwp-tenancy/ (outside uploads/) β€” prevents direct web access; existing installs on the old path are preserved automatically
  • Fix: Status page migration notice now references the correct new path
  • Fix: Clone page hero buttons replaced with standard buttons
  • Enhance: Admin bar Plugins / Themes nodes hidden on tenant sites when corresponding settings are enabled
  • Enhance: Tenant create page β€” auto-suggested domain, new Clear button, fluid input width, improved layout
  • Enhance: GrabWP Tenancy admin menu repositioned to the top of the sidebar
  • Change: Default values for Hide Plugin Management and Hide Theme Management changed to false for fresh installs

v1.0.8

  • New: Tenant cloning β€” duplicate any tenant (or mainsite) to a new tenant with DB copy and file sync
  • New: GRABWP_MAINSITE_ID (__mainsite__) constant for using mainsite as clone source
  • Enhance: Mainsite domain detection supports localhost and LAN domains with no TLD
  • Fix: Plugin asset URL resolution when the plugin directory is symlinked
  • Fix: Tenant ID generation now guarantees uniqueness
  • Quality: Normalised all source files to LF line endings

v1.0.7

  • Path-based routing, Status page UI, installer refactor, nonce security, autoloader fix

v1.0.6

  • Dedicated Status page, one-click MU-plugin and wp-config.php installers, admin notices

v1.0.5 – v1.0.0

See WordPress.org Changelog for full history.


License

GPLv2 or later β€” see LICENSE


Need enterprise isolation, dedicated databases, and per-tenant backups?
β†’ Upgrade to GrabWP Tenancy Pro Β· From $9.99/month Β· Code EARLYBIRDPRO for 20% off

About

GrabWP Tenancy provides the foundation for multi-tenant WordPress with essential isolation features. This plugin focuses on cost-effective multi-tenancy with shared resources and basic tenant separation. Download at https://wordpress.org/plugins/grabwp-tenancy/

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors