Recently on a project I wanted to migrate WordPress users with a certain role to a different role. This is the command I used.
wp-cli
Revert to Old Version of WordPress Core
These are the two ways I have used to rollback WordPress to an earlier version. Using either technique, you should make a backup copy of your files and your database first!
How to Set Older WordPress Posts to Draft with WP CLI
In one of the slack channels I follow, the question came up on how to set WordPress posts older than a certain date to “draft” status using with WP CLI. I was surprised by how difficult I found this task and wanted to document my solution.
WP CLI Output Results
When working with WP CLI, I often have data to output and instead of looking up how to do it each time, I wanted to make myself some notes.
Install a non-wordpress.org Plugin with WP CLI
The WordPress plugin repository at wordpress.org/plugins is a great resource. I often use WP CLI to install plugins on my WordPress site from there, however, sometimes I want to install other plugins with WP CLI.
WP-CLI move site locally
These are the steps I follow when I move the database for a website to my local computer using WP CLI.
WP-CLI LocalWP without “Open Site Shell”
I’ve become a big fan of LocalWP (formerly Local by Flywheel) for local WordPress development (i.e. running websites on my Mac). One thing I do find frustrating is the need to use “Open Site Shell” when I want to run a WP-CLI command. If you’re in a hurry to set this up, you can jump […]
Install Multiple WordPress Plugins with WP CLI
At a recent WordPress meetup we were discussing WP CLI and the comment came up, “When setting up a site, it would be nice to install a bunch of plugins with a single command.” Fortunately a WordPress meetup is a great place to bounce ideas off of smart people and find a solution. Solution 1: […]
Search WordPress Post and Post Meta
Recently, I had to find instances of where specific Gravity Forms were being used. This came with multiple challenges. Challenges Searching for gravityform id=”7″ returns results for just gravityform (i.e. too many results) If the gravity form appears in post meta (rather than the primary content), it is excluded (i.e. missing results) SQL Solution Find […]