Skip to main content

WordPress Core Setup Foundation

Performance optimization begins the moment you install WordPress. A clean, minimal core installation creates an audit-friendly environment that prevents bloat, limits security attack surfaces, and establishes an accurate baseline benchmark. Starting with a dirty installation pre-loaded with marketplace themes or sample content makes true optimization nearly impossible.

Core Idea

The goal of the core setup is to start with the absolute minimum number of plugins, themes, and database records required to run the site. This lean foundation is essential for accurate before-and-after performance testing.

Prerequisites & Preparation

  • VPS or server access with PHP, MySQL/MariaDB, and a web server configured.
  • wp-cli installed and verified via wp --info on the command line.
  • A functional SSH connection and basic terminal navigation skills.
  • Database credentials prepared correctly (database name, user, password).
  • Dedicated performance testing accounts ready (PageSpeed Insights, GTmetrix, Pingdom).

Core Structure / Commands

Download and Install WordPress

download-wordpress.sh
wp core download --locale=en_US

Create Config File

create-config.sh
wp config create --dbname=wp_db --dbuser=wp_user --dbpass='REPLACE_ME' --dbhost=localhost

Install WordPress (Silent, Fast)

install-wordpress.sh
wp core install --url="https://example.com" --title="Clean WP Base" --admin_user=admin --admin_password='REPLACE_ME' --admin_email=me@example.com

Post-Install Cleanup

Destructive Commands

The following deletes plugins/themes/content. Run it only on a fresh install (or after backing up and confirming what will be removed).

cleanup-wp.sh
wp plugin delete hello
wp theme delete twentyseventeen twentynineteen twentytwenty
wp post delete $(wp post list --post_type='post' --format=ids)

Baseline Benchmark

Before adding a single plugin or third-party theme, establish your baseline.

  • Run synthetic tests using Page.dev and GTmetrix and record a baseline.
  • (Optional) Install the WP-CLI profile command on staging so you can use wp profile ....
  • Record the raw TTFB, LCP, CLS, and INP metrics so you have a true zero-point to compare against later.
install-wp-cli-profile-command.sh
wp package install wp-cli/profile-command

Benefits of a Clean Installation

  • Prevents Bloat: Blocks the accumulation of demo plugins, starter content, and marketplace junk.
  • Audit-Friendly: Creates a highly predictable baseline for long-term maintenance.
  • Reduced Attack Surface: Deleting unused themes and plugins immediately hardens the site's security layout.
  • Fastest First-Paint: Ensures the absolute lowest FCP/LCP times possible for your server hardware.
  • Traceability: Prevents the "I don't know what slowed the site down" scenario by establishing immediate benchmarks before complexity is introduced.

Implementation Steps (Hands-On)

  1. Connect via SSH and cd directly into your site root directory.
  2. Execute the wp core download and wp config create WP-CLI commands.
  3. Install the site silently using wp core install.
  4. Delete default themes, sample posts, and "Hello Dolly" immediately.
  5. Use PageSpeed Insights and GTmetrix to measure TTFB, LCP, and CLS. Save these results officially as your core benchmark.

Static vs Dynamic Framing

Core Setup Focus: Extreme emphasis on maintaining minimal active plugins, utilizing a highly lean block theme, and targeting the absolute lowest un-cached TTFB globally.

Best Practices & Pitfalls

Best Practices:

  • Rely exclusively on WP-CLI over graphical installers — it is faster, reproducible, and easily scriptable.
  • Always meticulously document every CLI command you execute in your deployment checklist.
  • Utilize the --skip-email and --quiet flags when executing automated bash scripts.

Pitfalls to Avoid:

  • Retaining "Hello Dolly" or default sample posts artificially expands the database footprint.
  • Starting a project with a preloaded marketplace theme guarantees you inherit that theme's hidden performance debt.
  • Skipping the baseline synthetic benchmark eliminates any possibility of accurately tracing future regressions.

Troubleshooting Matrix

SymptomLikely CauseFix
TTFB > 1s on fresh installServer stack overhead (DNS/TLS/PHP/DB)Re-audit the VPS stack and verify you're testing the origin request path consistently
Very high LCPHeavy default assetsStart entirely from a minimal WP baseline
Post-launch errors map backDirty server migrationRedo the migration using a clean core install process
Slow wp-adminObject cache conflictProfile thoroughly before activating complex plugins

Quick Lab

End-to-End Setup Lab
wp-core-setup-lab.sh
# 1. Setup WordPress Core via WP-CLI
wp core download --locale=en_US
wp config create --dbname=demo --dbuser=wp_user --dbpass='REPLACE_ME'
wp core install --url="https://yoursite.com" --title="Demo" --admin_user=admin --admin_password='REPLACE_ME' --admin_email=you@example.com

# 2. Immediately remove all default bloat
wp plugin delete hello
wp theme delete twentyseventeen

# 3. Verify health and versioning
wp core version

Cheat Sheet

View Core Setup Commands
wp-cli-cheat-sheet.sh
wp core download --locale=en_US
wp config create --dbname=... --dbuser=... --dbpass=...
wp core install --url="..." --title="..." --admin_user=... --admin_password=... --admin_email=...
wp plugin delete hello
wp theme delete twenty*
Summary

A clean core installation is the non-negotiable prerequisite for WordPress performance optimization. By utilizing WP-CLI to script a minimal, bloat-free foundation and establishing an immediate performance baseline, you guarantee accurate analytics and a significantly smaller attack surface.

What's Next