Changing WordPress versions in the Local by Flywheel app

[ Update 2017-11-29: There is now a dedicated script for the Local app available here: ]

Local is a free Mac app to develop WordPress locally. The beauty is you can very quickly change the development environment of a site. It enables you to swap between different types of servers and versions of PHP with a single click. The only thing you can’t change (from the user interface) is the WordPress version. This something you don’t do very often, but It got me thinking. I’ve written a script to install older versions of WordPress for VVV. And as it turns out it’s fully compatible with the Local app. It lets you easily change WordPress versions all the way down to 0.71-gold. There are however some simple steps needed to set it up.


You need to have a site installed and running in the Local app
Click the site in the Local app and see what the Site Path directory is.
Go to /app directory inside the Site Path directory and download the file from the WP Nostalgia repository.

curl -O

Edit the following variables in the file to match the url and credentials of the WordPress site. You can find the database credentials values by clicking Database in the Local App.

# =============================================================================
# Variables
# Note: Don't use spaces around the equal sign when editing variables below.
# =============================================================================

# Domain name
# Note: If edited, you'll need to edit it in the vvv-hosts and the vvv-nginx.conf files as well.
readonly HOME_URL=""

# WordPress version to be installed. Default: "0.71-gold"
# See the release archive:
# Use a version number or "latest"

# Remove errors. Default true
readonly REMOVE_ERRORS=true

# Database credentials
readonly DB_NAME="wp-nostalgia"
readonly DB_USER="wp"
readonly DB_PASS="wp"

# WordPress credentials
readonly WP_USER="admin"
readonly WP_PASS="password"

That’s it. You can now change WordPress versions very quickly.

Changing WordPress Versions

Warning: Changing WordPress versions with this script completely removes all your files in the site’s public folder and deletes the database before installing a new version.

Right click the site and choose Open Site SSH.

A terminal window will open. Go to the app folder by typing this.

cd /app

To install WordPress 4.2 type this

bash 4.2

If all went well it shows a message with instructions how to finish the install.

Finished Setup with version: 4.2!
Visit Username: admin, Password: password

Change the version number to install any other version found in the WordPress release archive.

Note To install WordPress version 3.8 or lower your site needs to be running PHP 5.3. You can change the PHP version for your site in the Local app.


2 thoughts on “Changing WordPress versions in the Local by Flywheel app

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s