cification
Start by mapping your required state. A blueprint should explicitly declare themes, plugins, site preferences, cleanup policies, and debug behavior. Avoid implicit assumptions; every setting must be intentional.
interface WpProvisioningSpec {
identifier: string;
baseline: {
themes: string[];
plugins: string[];
customAssets: Array<{
type: 'theme' | 'plugin';
sourceUrl: string;
autoActivate: boolean;
}>;
};
siteConfig: {
locale: string;
timezone: string;
dateFormat: string;
timeFormat: string;
seoIndexing: boolean;
mediaOrganization: boolean;
permalinkStructure: 'post-name' | 'custom' | 'default';
customPermalink?: string;
};
cleanupPolicy: {
removeDefaultPost: boolean;
removeSamplePage: boolean;
purgeUnusedThemes: boolean;
purgeUnusedPlugins: boolean;
stripCoreTemplates: boolean;
};
debugConfig: {
enabled: boolean;
logToFile: boolean;
displayOnScreen: boolean;
};
}
Site preferences dictate how WordPress interacts with the server environment and external crawlers. The timezone setting is critical: it directly impacts WP-Cron scheduling, scheduled post publication, and log rotation. Always align this with your server's UTC offset or explicitly set it to your operational timezone.
Permalink structure should be defined at provisioning time. Changing permalinks post-deployment forces WordPress to regenerate rewrite rules, which can cause temporary 404 errors and cache invalidation storms. The post-name structure (/sample-post/) is recommended for SEO and readability. If custom tags are required, use WP-CLI compatible placeholders (%year%, %postname%, %category%).
Step 3: Establish Cleanup & Debug Policies
Cleanup rules execute immediately after WordPress core installation. They remove default artifacts that serve no purpose in production:
Hello World post and Sample Page are removed to prevent accidental publishing.
Purge Unused Themes/Plugins should only be enabled when your blueprint explicitly declares the required assets. Otherwise, you risk stripping default fallbacks needed for theme compatibility.
Strip Core Templates removes legacy template files, reducing the attack surface and disk footprint.
Debug configuration requires strict environment separation:
logToFile writes errors to wp-content/debug.log. This is safe for production monitoring.
displayOnScreen outputs errors directly to HTTP responses. Keep this disabled in live environments to prevent information leakage.
enabled toggles WP_DEBUG. Use this selectively for staging or development blueprints.
Step 4: Bind to the Provisioning Pipeline
Once the specification is saved, ServerAvatar registers it as a reusable deployment target. During new WordPress application creation, the platform presents the blueprint as a selectable configuration layer. Under the hood, ServerAvatar executes a sequenced WP-CLI pipeline:
- Core installation
- Theme/plugin installation via repository or custom URL
- Activation hooks
- Option updates (
wp option update)
- Cleanup execution
- Debug flag injection
This pipeline runs synchronously during provisioning, ensuring the site reaches the desired state before DNS propagation or SSL certificate issuance completes.
Architecture Rationale
The declarative approach eliminates race conditions common in post-install scripts. By defining the target state upfront, the provisioning engine can validate dependencies, skip redundant operations, and rollback on failure. This mirrors infrastructure-as-code principles, making WordPress deployments auditable, version-controlled, and reproducible across environments.
Pitfall Guide
1. Plugin Dependency Overload
Explanation: Bundling too many plugins into a single blueprint increases provisioning time and introduces conflict risks. Plugins with overlapping functionality or incompatible PHP version requirements will cause silent failures during activation.
Fix: Audit plugin dependencies before inclusion. Limit blueprints to 8β12 core plugins. Use feature flags or environment-specific blueprints to separate development tools from production requirements.
2. Debug Flags Left Active in Production
Explanation: Enabling displayOnScreen or enabled in a production blueprint exposes stack traces, database credentials, and file paths to end users. This is a critical information disclosure vulnerability.
Fix: Maintain separate blueprints for staging and production. Production blueprints should only use logToFile: true with displayOnScreen: false. Implement a pre-deploy checklist to verify debug states.
3. Permalink Structure Mismatches Post-Deploy
Explanation: Changing permalink settings after initial deployment forces WordPress to flush rewrite rules. If caching layers (Varnish, Nginx fastcgi_cache, or CDN) are already active, this causes temporary routing failures.
Fix: Define permalinkStructure during blueprint creation. If custom structures are required, test them in a staging environment first. Always clear object caches immediately after provisioning.
4. Overzealous Cleanup Breaking Child Themes
Explanation: Enabling purgeUnusedThemes while relying on a child theme that inherits from a parent not explicitly listed in the blueprint will break the site. WordPress requires the parent theme to be present for child theme inheritance.
Fix: Always declare both parent and child themes in the themes array. Alternatively, disable purgeUnusedThemes and manually curate the theme directory post-deployment.
5. Timezone/Cron Synchronization Drift
Explanation: Setting a timezone in the blueprint that differs from the server's system timezone causes WP-Cron to fire at incorrect intervals. Scheduled posts, backup jobs, and cache purges will drift out of alignment.
Fix: Align the blueprint timezone with the server's date.timezone PHP setting. Use UTC as the baseline and handle localization at the application layer if needed. Verify cron execution with wp cron event list.
6. Unreliable Custom Plugin URLs
Explanation: Hosting custom themes or plugins on temporary or unauthenticated URLs causes provisioning failures. If the URL returns a 403, 404, or requires authentication, the blueprint installation halts.
Fix: Host custom assets on versioned, publicly accessible endpoints with stable checksums. Use direct .zip download links from private repositories or internal artifact storage. Validate URLs before saving the blueprint.
7. Ignoring Search Engine Indexing Defaults
Explanation: Leaving seoIndexing enabled on staging or client review sites allows search engines to index incomplete content, causing duplicate content penalties and premature indexing.
Fix: Set seoIndexing: false for all non-production blueprints. Enable indexing only when the site passes QA and is ready for public traffic. Document this toggle in your deployment runbook.
Production Bundle
Action Checklist
Decision Matrix
| Scenario | Recommended Approach | Why | Cost Impact |
|---|
| Single Client Delivery | Lightweight Blueprint (5β8 plugins, post-name permalinks, debug off) | Reduces handover friction and ensures consistent baseline | Low setup, high ROI on support time |
| Multi-Tenant Agency | Environment-Segregated Blueprints (staging vs production) | Prevents debug leakage and indexing conflicts across client sites | Moderate initial config, eliminates rework |
| Internal Staging/Dev | Full-Debug Blueprint with verbose logging and sample data | Accelerates developer onboarding and testing cycles | Negligible infrastructure cost, high velocity gain |
| High-Traffic Production | Minimalist Blueprint (core plugins only, strict cleanup, log-only debug) | Reduces attack surface, improves TTFB, simplifies caching | Higher upfront curation, lower long-term maintenance |
Configuration Template
{
"blueprintName": "agency-production-baseline-v2",
"themes": ["astra", "astra-child-custom"],
"plugins": [
"wpforms-lite",
"wordfence",
"wp-rocket",
"duplicator",
"custom-post-type-ui"
],
"customAssets": [
{
"type": "plugin",
"sourceUrl": "https://artifacts.internal.example.com/plugins/custom-woo-extensions-v1.4.zip",
"autoActivate": true
}
],
"sitePreferences": {
"language": "en_US",
"timezone": "America/New_York",
"dateFormat": "F j, Y",
"timeFormat": "g:i a",
"disableSearchIndexing": false,
"organizeUploads": true,
"permalinkStructure": "post-name"
},
"cleanupRules": {
"removeHelloWorld": true,
"removeSamplePage": true,
"deleteUnusedThemes": true,
"deleteUnusedPlugins": true,
"stripLegacyTemplates": true
},
"debugSettings": {
"enableDebug": false,
"logToFile": true,
"displayErrors": false
}
}
Quick Start Guide
- Access the Blueprint Manager: Navigate to the WordPress Blueprints section in your ServerAvatar dashboard and click
Create Blueprint.
- Define Baseline Assets: Add your required themes and plugins. If using custom assets, paste the direct
.zip URL and enable auto-activation.
- Configure Runtime Policies: Set timezone, permalink structure, and debug flags. Enable cleanup rules that match your asset declarations.
- Save & Validate: Name the blueprint descriptively and save. Create a test WordPress application, select the blueprint from the deployment dropdown, and verify the site reaches the expected state within 60 seconds.
- Promote to Production: Once validated, apply the blueprint to client or production deployments. Maintain versioned copies when updating plugin lists or debug policies.