• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Archives for wp-cli

wp-cli

WP CLI Migrate User Roles

Last updated on December 17, 2020 by Sal Ferrarello

Recently on a project I wanted to migrate WordPress users with a certain role to a different role. This is the command I used.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Solution Tagged With: WordPress, wp-cli

Revert to Old Version of WordPress Core

Last updated on May 20, 2020 by Sal Ferrarello

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!

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: WordPress Core, wp-cli

How to Set Older WordPress Posts to Draft with WP CLI

Last updated on April 5, 2019 by Sal Ferrarello

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.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: WordPress, wp-cli

WP CLI Output Results

Last updated on January 31, 2019 by Sal Ferrarello

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.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Programming Tagged With: wp-cli

Install a non-wordpress.org Plugin with WP CLI

Last updated on November 19, 2018 by Sal Ferrarello

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.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: WordPress, WordPress Plugin, wp-cli

WP-CLI move site locally

Last updated on April 30, 2020 by Sal Ferrarello

These are the steps I follow when I move the database for a website to my local computer using WP CLI.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft Tagged With: wp-cli

WP CLI LocalWP Without Open Site Shell.

WP-CLI LocalWP without “Open Site Shell”

Last updated on September 24, 2021 by Sal Ferrarello

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 […]

Filed Under: Dev Tips, Programming, Solution Tagged With: ssh, WordPress, wp-cli

Command line output from running command to install multiple plugins.

Install Multiple WordPress Plugins with WP CLI

Last updated on January 24, 2018 by Sal Ferrarello

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: […]

Filed Under: Dev Tips, Programming, Solution Tagged With: command line, WordPress, wp-cli

Screenshot of wp find-content command being run to find a specific Gravity Form shortcode

Search WordPress Post and Post Meta

Last updated on January 11, 2018 by Sal Ferrarello

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 […]

Filed Under: Programming, Solution Tagged With: command line, MySQL, WordPress, wp-cli

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in