This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A bash script to batch update a server's WordPress sites with WP-CLI. It requires WP-CLI, obviously (https://wp-cli.org/). | |
# The script will search for all WordPress installations under a given directory and will update them. You can declare more than one such directories. | |
# You don't have to modify the script every time you add a new site. As long as the new site is under a declared parent directory, its database will be backed up. | |
# After creating the file, don't forget to make it executable by doing: | |
# chmod +x update_sites.sh | |
# Set PATH environment variable | |
export PATH="/usr/local/bin:/usr/bin:/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A bash script to run WP-CLI commands on multiple sites at once. It requires WP-CLI, obviously (https://wp-cli.org/). | |
# The script will search for all WordPress installations under a given directory and will run the command. You can declare more than one such directories. | |
# You don't have to modify the script every time you add a new site. As long as the new site is under a declared parent directory, its database will be backed up. | |
# After creating the file, don't forget to make it executable by doing: `chmod +x superwp.sh`. Then, include it to `.bashrc` or `.bash_profile` by adding `source path/to/superwp.sh`. | |
# Then, you can run any `wp` command you like on all the sites of your server, by replacing `wp` with `superwp`. | |
# Example: `superwp plugin list`. | |
# We use a function, in order to be able to call it as many times as we want, for as many different directories containing WordPress installations there are on the server |
OlderNewer