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

wp-cli

WP CLI Get Current Theme

Last updated on October 30, 2024 by Sal Ferrarello

I thought retrieving the currently active theme on a WordPress website with WP CLI would involve the “wp theme” command but I was wrong. The correct command to get the currently active theme is “wp option get current_theme”.

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

WP CLI Find in Post

Last updated on August 9, 2024 by Sal Ferrarello

Sometimes I want a list of blog posts that contain a certain string. For example, I might want a list of all blog posts that contain the word “kazoo” using WP CLI. My favorite tool for this is “wp post list”.

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

Loop Through WordPress Multisite Blogs with WP CLI

Last updated on September 3, 2024 by Sal Ferrarello

When working on a WordPress multisite with WP CLI, it can be helpful to loop through all of the individual sites.

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

Quick and Dirty WP CLI

Last updated on January 19, 2024 by Sal Ferrarello

During development or troubleshooting I often find myself wanting to run something through WP CLI. These are some notes on running code through WP CLI.

Filed Under: Dev Tips, Programming Tagged With: WordPress, 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 18, 2025 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

  • Page 1
  • Page 2
  • Next Page»

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