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.
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.
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.
These are the steps I follow when I move the database for a website to my local computer using WP CLI.
I’ve become a big fan of Local by Flywheel for local WordPress development (i.e. running websites on my Mac). One thing I do find frustrating is the need to SSH into my Local by Flywheel website when I want to run a WP CLI command. Thanks to some great work by Morgan Estes with his […]
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: […]
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 […]