Last active
July 12, 2021 07:18
-
-
Save MikeNGarrett/fa4216b34495573e433f2e1d945c4569 to your computer and use it in GitHub Desktop.
Chained WordPress CLI commands to install and activate recommended plugins.
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
# wordpress-seo provides ability to edit meta information and provides sitemap. | |
# w3-total-cache provides advanced caching no matter the server technology available. | |
# better-wp-security provides brute force protection and a number of WordPress enhancements. | |
# google-analytics-for-wordpress provides robust Google Analytics integration through the Google API. | |
# redirection detects 404s and 301s and allows admins to set up redirects in the WP admin. | |
# ewww-image-optimizer provides automatic optimization of uploaded images with local libraries instead of cloud-based services. | |
# backupwordpress simple backup solution that can store backups above web root. | |
# relevanssi provides better site search using a local index. | |
# cloudflare is the best. Free automatic CDN and security solution. | |
# jarvis is a quick search for the WordPress admin. Indespensible. | |
# Array of plugin slugs as listed above. h/t @wpbullet | |
plugins=( wordpress-seo w3-total-cache better-wp-security google-analytics-for-wordpress redirection ewww-image-optimizer backupwordpress relevanssi cloudflare jarvis ) | |
# Install and activate each plugin. h/t @blindpet Trevor Anderson Mike Andreasen | |
wp plugin install --activate ${plugins[@]} |
Nice work, you can also use an array and one line them, WP-CLI is smart enough to know what to do with the spaced list
#array of plugins
WPPLUGINS=( wordpress-seo ewww-image-optimizer better-wp-security )
wp plugin install ${WPPLUGINS[@]} --activate
Documented them here
Thanks for the feedback. Updated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Each line can be reduced to
wp plugin install wordpress-seo --activate