Updating multiple composer.json files

Hi *,
recently we had to update WPML version in composer.json for a site, it turned out that also many other sites had to be updated so we needed to adapt composer.json manually for each site.

Is there a way to set include statements in composer.json in oder to include .e.g a common file called composer-common.json which when get’s updated will propagate it’s modification across multiple sites?

If not I’m considering to write a simple sed script in order to update the strings in all composer.json files. Thanks for suggestions. Saluti,


1 Like

There’s no built-in way to do this but it’s a lot easier than replacing a string.

If you want to update a package version just do: composer require composer/installers:v1.0.18 for example.


Perfect, thanks. An idea could be to write a script which will do this for each site which is maintained.