{"id":37236793,"url":"https://github.com/handpressed/wp-multitenancy-boilerplate","last_synced_at":"2026-01-16T04:53:38.979Z","repository":{"id":51716747,"uuid":"124699320","full_name":"handpressed/wp-multitenancy-boilerplate","owner":"handpressed","description":"WordPress multitenancy boilerplate configured and managed with Composer and PHP dotenv.","archived":false,"fork":false,"pushed_at":"2024-12-15T23:21:55.000Z","size":43,"stargazers_count":41,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-30T01:46:38.506Z","etag":null,"topics":["composer","multitenancy","phpdotenv","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/handpressed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-10T21:19:32.000Z","updated_at":"2024-12-15T23:21:59.000Z","dependencies_parsed_at":"2024-12-16T00:20:41.896Z","dependency_job_id":"5aed885d-097a-4d22-9d81-d516499a8365","html_url":"https://github.com/handpressed/wp-multitenancy-boilerplate","commit_stats":{"total_commits":66,"total_committers":4,"mean_commits":16.5,"dds":"0.18181818181818177","last_synced_commit":"a3d4c1d71a5228f985366c5e6918184defc7ee86"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/handpressed/wp-multitenancy-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handpressed%2Fwp-multitenancy-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handpressed%2Fwp-multitenancy-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handpressed%2Fwp-multitenancy-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handpressed%2Fwp-multitenancy-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/handpressed","download_url":"https://codeload.github.com/handpressed/wp-multitenancy-boilerplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handpressed%2Fwp-multitenancy-boilerplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","multitenancy","phpdotenv","wordpress"],"created_at":"2026-01-15T04:17:10.917Z","updated_at":"2026-01-15T04:17:11.521Z","avatar_url":"https://github.com/handpressed.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress Multitenancy Boilerplate\n\nUse Composer to configure and manage a WordPress instance (including themes and plugins) that's shared with multiple sites.\n- [WordPress Multitenancy Boilerplate](#wordpress-multitenancy-boilerplate)\n\t- [Features](#features)\n\t- [Requirements](#requirements)\n\t- [Prerequisites](#prerequisites)\n\t- [Installation](#installation)\n\t- [Configuration](#configuration)\n\t\t- [Themes](#themes)\n\t\t- [Plugins](#plugins)\n\t\t- [Constants](#constants)\n\t- [Directory Structure](#directory-structure)\n\t- [Adding Sites](#adding-sites)\n\t\t- [Configuration](#configuration-1)\n\t- [See Also](#see-also)\n\t- [Credit](#credit)\n\n## Features\n\n- Improved directory structure\n- Dependency management with [Composer](https://getcomposer.org)\n- Easy WordPress configuration with environment and constants files\n- Environment variables with [PHP dotenv](https://github.com/vlucas/phpdotenv)\n- Enhanced security (separated web root and secure passwords with [roots/wp-password-bcrypt](https://github.com/roots/wp-password-bcrypt))\n- WordPress [multitenancy](https://en.wikipedia.org/wiki/Multitenancy) (a single instance of WordPress core, themes and plugins serving multiple sites)\n\n## Requirements\n\n- PHP 8.1+\n- Composer\n\n## Prerequisites\n\n[Install Composer](https://getcomposer.org/doc/00-intro.md):\n\n```bash\n$ curl -sS https://getcomposer.org/installer | php \u0026\u0026 mv composer.phar /usr/local/bin/composer\n```\n\n## Installation\n\n```bash\n$ composer create-project handpressed/wp-multitenancy-boilerplate:dev-main {directory}\n\n$ cd {directory}\n```\n\nReplace `{directory}` with the name of your new WordPress project, e.g. its domain name.\n\nComposer will download WordPress, move it to `/var/opt/wp` and then symlink `/var/opt/wp` to `web/wp` (see [Directory Structure](#directory-structure)).\n\nComposer will also symlink `/var/opt/wp/wp-content/themes` to `web/app/themes`, `/var/opt/wp/wp-content/plugins` to `web/app/plugins` and `/var/opt/wp/wp-content/mu-plugins` to `web/app/mu-plugins`.\n\nSites can now share this single instance of WordPress.\n\n## Configuration\n\nOpen the `conf/.env` file and add your new site's home URL (`WP_HOME`) and database credentials (`DB_NAME`, `DB_USER`, `DB_PASSWORD`). You can also define the database `$table_prefix` (default is `wp_`) if required.\n\nSet your site's vhost document root to `/path/to/{directory}/web`.\n\n### Themes\n\nAdd themes in `web/app/themes` as you would for a normal WordPress install.\n\n### Plugins\n\n[WordPress Packagist](https://wpackagist.org) is already registered in the `composer.json` file so any plugins from the [WordPress Plugin Directory](https://wordpress.org/plugins/) can easily be required.\n\nTo add a plugin, use `composer require \u003cnamespace\u003e/\u003cpackagename\u003e` from the command-line. If it's from WordPress Packagist then the namespace is always `wpackagist-plugin`, e.g.:\n\n```bash\n$ composer require wpackagist-plugin/wp-optimize\n```\n\nWhenever you add a new plugin or update WordPress core, run `composer update` to install your new packages.\n\nThemes and plugins are installed in the symlinked `themes` and `plugins` directories in `/var/opt/wp/wp-content` and will be available to all multitenancy sites.\n\nNote: Some plugins may make modifications to the core `wp-config.php` file. Any modifications to `wp-config.php` that are needed by an individual site should be moved to the site's `conf/wp-constants.php` file.\n\n### Constants\n\nPut custom core, theme and plugin constants in `conf/wp-constants.php`.\n\n## Directory Structure\n\n    ├── composer.json             → Manage versions of WordPress, plugins and dependencies\n    ├── conf                      → WordPress configuration files\n    │   ├── .env       \t      → WordPress environment variables (WP_HOME, DB_NAME, DB_USER, DB_PASSWORD required)\n    │   ├── wp-constants.php      → Custom core, theme and plugin constants\n    │   ├── wp-env-config.php     → Primary WordPress config file (wp-config.php equivalent)\n    │   └── wp-salts.php          → Authentication unique keys and salts (auto generated)\n    ├── vendor                    → Composer packages (never edit)\n    └── web                       → Web root (vhost document root)\n        ├── app                   → wp-content equivalent\n        │   ├── mu-plugins        ↔ Must-use plugins symlinked to /var/opt/wp/wp-content/mu-plugins\n        │   ├── plugins           ↔ Plugins symlinked to /var/opt/wp/wp-content/plugins\n        │   ├── themes            ↔ Themes symlinked to /var/opt/wp/wp-content/themes\n        │   └── uploads           → Uploads\n        ├── index.php             → Loads the WordPress environment and template (never edit)\n        └── wp                    ↔ WordPress core symlinked to /var/opt/wp (never edit)\n\t    \t└── wp-config.php     → Required by WordPress - loads conf/wp-env-config.php (never edit)\n\n`↔` denotes a symlink.\n\n## Adding Sites\n\nUse [WP Multitenancy Add Site](https://github.com/handpressed/wp-multitenancy-add-site).\n\n```bash\n$ composer create-project handpressed/wp-multitenancy-add-site {new_directory}\n\n$ cd {new_directory}\n```\n\nReplace `{new_directory}` with the name of your new project, e.g. its domain name.\n\n### Configuration\n\nOpen the `conf/.env` file and add the new site's home URL (`WP_HOME`) and database credentials (`DB_NAME`, `DB_USER`, `DB_PASSWORD`). You can also define the database `$table_prefix` (default is `wp_`) if required.\n\nSet the new site's vhost document root to `/path/to/{new_directory}/web`.\n\nAdded sites will use the existing WordPress instance (including themes and plugins) in `var/opt/wp`.\n\n## See Also\n\n[WordPress Substratum](https://github.com/handpressed/substratum)\n\n## Credit\n\nBased on [handpressed/substratum](https://github.com/handpressed/substratum). Inspired by [roots/bedrock](https://github.com/roots/bedrock) and [wpscholar/wp-skeleton](https://github.com/wpscholar/wp-skeleton).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandpressed%2Fwp-multitenancy-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhandpressed%2Fwp-multitenancy-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandpressed%2Fwp-multitenancy-boilerplate/lists"}