Pull the WordPress database, push the code

Multi-environment (development, staging, production, etc.) WordPress websites can follow a very simple deployment strategy. The database should only be pulled from a production website while code changes should be pushed to a production site. This method uses a technique called “two-way data flow.”

This method breaks from a standard software engineering practice of pushing a website from a development to production environment due to the design (and versatility) of the WordPress database. WordPress plugin authors often use the built in database tables of WordPress rather than making separate tables that can be individually tracked. Thus, many WordPress developers respond by depending on the built in version control of WordPress, manual backups, or import/export functionality to manage content changes. Pull the database.

Code changes, even if created with a code snippet plugin, should always be tested on a copy of a the live site. These changes can be migrated after successful testing. This strategy prevents critical site errors from happening on a production site. Push code.