You don’t have to open new WordPress projects in new IntelliJ IDEA windows and jump between them. Instead, manage multiple sites in a single IntelliJ Solution. This post describes how to quickly setup an IntelliJ Project that enables you to work in multiple WordPress sites simultaneously, and with individual site debugging as well.
Let’s look at the project layout to understand what we’re after. We have two WordPress sites, WP Complete and WP Deconstructed. (Don’t worry about the “Complete/Deconstructed” thing for now. That may come into play in a future post, but for now it’s not relevant.)
To get things rolling, the type of IntelliJ project we want to create is an EMPTY PROJECT. We’ll call it “WP Combined” and will place it in a new directory.
Now we can add as many WordPress projects as we like, adding them AS MODULES. Simply point to the project’s root, which will also serve as the “Module file location” in the new module configuration window.
We go to Run -> Edit Configurations to configure our websites for debugging. The main issue here is to create a PHP Web application for each project as well as a PHP Application Server for each site url, in our case http://wpcomplete and http://wpdecon.
When we want to debug we simply select the site run/debug option and go!