Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, set up multisite installs and much more, without using a web browser.

1
vote
1answer
602 views

wp-cli installation

i installed 0h-my-zsh; then wp-cli, change .zshrc file and wrote : # FIX PHP MAMP for WP-CLI export PATH=/Applications/MAMP/bin/php/php5.6.2/bin:$PATH export PATH=$PATH:/Applications/MAMP/Library/bin/...
12
votes
4answers
3k views

how to update serialized options programatically?

I want to automate updating plugin options. There are some things that I repeat a lot. With wp-cli I know I can update simple options like this: php wp-cli.phar option update blog_public 1 However, ...
1
vote
0answers
90 views

How can I add an RSS widget using WP-CLI?

I can add an rss widget with this command: wp widget add rss my-sidebar --title=News --items=5 But when I add a URL parameter, like this: wp widget add rss my-sidebar --title=News --items=5 --url=...
0
votes
1answer
149 views

How to move back a command in WP-CLI from wp shell?

Absolute beginner here... I'm familiarizing myself with WP-CLI, and I typed "wp shell" taking me to wp> (input box) How do I escape wp shell and go back to ["username" /home/public] (input box)? I'm ...
4
votes
2answers
2k views

How to change user_login with wp-cli?

How to change the username with wp-cli? This does not work: wp user update old_login --user-login=new_login
9
votes
2answers
9k views

How to change user password with wp-cli?

wp-cli is great. But it's not clear how I can quickly change a user password with it. How to change a user's password programatically can probably help to figure this out. Although wp user ...
3
votes
3answers
4k views

How to use wp-cli.yml file?

I am trying to set up a wp-cli.yml file but everytime I run the command, the file is ignored. Where should the file be located? And how should I call the command to use it? I tried having a file in ...
1
vote
2answers
881 views

How do I set and list page_template with wpcli?

I have a page that has a new template, and I want to set that new template with wp-cli. When I wp post get <id> I get an output like the following: +-----------------------+--------------------...
1
vote
1answer
81 views

Wrong output order when mixing WP_CLI::API and php-cli-tools

Fixed by WordPress update - cause unknown. I have a couple of plugins that use various custom WP-CLI commands I've written. I've copied then from one WordPress project – where it's working correctly ...
0
votes
1answer
262 views

PHP Parse error on WP-CLI, not on web server

I have a network of over a hundred sites and I try to use wp-cli to make bulk changes to many of these. Particularly to their wp_x_options table via wp --url=site.url option update However, wp ...
4
votes
1answer
3k views

How can I bulk delete media and attachments using WP-CLI?

I'm trying to mass delete 4000 images in a wordpress website. WP itself sets the max to 999, which would work fine and take a few minutes to delete them via the backend. However, I get REQUEST URI TOO ...
1
vote
1answer
647 views

Local Wordpress installs don't verfiy against wp-cli checksum check and how to fix that issue.

i've installed wp-cli today, while testing i ran into one surprising issue. on `wp core verify-checksums' the following errors showed up: Warning: File doesn't verify against checksum: wp-includes/...
2
votes
2answers
4k views

How Can I setup WP CLI on Windows development machine running AMPPS?

I want to setup WP CLI. On the home page it says that it needs a UNIX like operating system. I am running windows 7 for development but I could probably setup a virtual Ubuntu box or something. Would ...
1
vote
2answers
183 views

What's a better workflow for database migration?

When asked to work on an existing WordPress Site, I generally take a copy of the whole site and work on it locally. For quite a few years I have used a script such as the following after importing the ...
1
vote
1answer
41 views

Is resetting post data necessary with custom WP_CLI commands?

Is it strictly necessary to call wp_reset_postdata(); in a WP CLI command? I am doing it out of habit but just wondered if the $post object needed to be reset.
2
votes
2answers
683 views

WP CLI to set options

I have WP-CLI working fine using WP Multisite (or network). I can create blogs, add users, set permissions etc. But am not certain how to enable plugins for individual blogs via WP CLI. For example, ...
15
votes
4answers
4k views

Running WP Cron on multisite the right way

I have WordPress Multisite with several sites. I set up DISABLE_WP_CRON to true in my wp-config.php. If we set up cron task with wget or curl we have 30 sec rule to execute PHP script. It's so small ...
2
votes
1answer
1k views

How to perform WordPress backups using wp-cli?

I am relatively new to working with WordPress, but I am very comfortable with, and prefer to use the command line. I need to backup WordPress before performing a version upgrade. I came across wp-cli ...
5
votes
1answer
284 views

How to create a WP-CLI command with $_POST?

I would like to create a WP-CLI command for WordPress Database Reset plugin. In the main function it uses $_POST for the options but when running the command in cli they will not exist. How should ...
2
votes
1answer
897 views

how do you use Wp-cli on Shared Hosting? [closed]

I Have Godaddy Deluxe linux hosting it is shared server, so I don’t have the root password of the machine. I can create, move and delete files via SSH in my home folder but not in the root ...
2
votes
1answer
1k views

wp-cli import theme sample data

i am trying to create an automated process of installing a wordpress site from scrach (no db, no user, no files, no settings) to the point were the site is up and it has it's own custom theme with the ...
7
votes
1answer
1k views

Wordpress test environment on windows

I'm new to TDD and want to set up a test environment for my wordpress plugin. I was able to find a sample plugin from wp-cli with the very useful script. It was very easy to write the first test ...
4
votes
3answers
2k views

wp-cli is not working properly. No response from commands

I am trying to make a copy of a live site on a test server. I installed wp-cli and wp-cli sometimes works and sometimes doesn't. When it doesn't work, it just returns nothing. Not one character of ...
1
vote
1answer
228 views

Jetpack Upgrade fails with WP CLI [closed]

Been trying to upgrade Jetpack from the admin for a few times on my site on a shared package with my hosted Dreamhost. It failed too often. I emailed on issues upgrading before and they suggested I ...
7
votes
4answers
2k views

WP-CLI Cannot Connect to Database due to Vagrant

I am running the most recent version of WP-CLI on my mac. I do all WordPress development within Vagrant, but would like to run WP-CLI commands in the host machine. I have a domain alias from "dev....
0
votes
0answers
551 views

All plugins deactivated. What could cause this?

I have an AWS server running four WordPress sites. All plugins have been deactivated on one of the sites and I cannot enable them. When I try enabling them in bulk, or individually, there is no ...
8
votes
1answer
537 views

wp-cli 0.14.1 MySQL error

I just updated to wp-cli 0.14.1 today and once again having a MySQL issue. I'm on Windows, Wampserver, and Cygwin. When I first updated to the last rev (0.14.0) I had a similar problem and wound up ...
3
votes
1answer
1k views

Using wp-cli to Update WP Networks / Multisite from 3.5.1 to 3.8

I've been handed a WP Networks site that is running WP (Networks) 3.5.1 on RHEL 5.8 with about 40 sites attached to it. I see the need to update to 3.8. By background, I'm more familiar with ...
4
votes
1answer
169 views

WP-CLI works on non WP-CLI installed Wordpress instance?

I came across WP-CLI via the tutorial at http://centminmod.com/nginx_configure_wordpress_ffpc_plugin.html and was wondering does WP-CLI work on Wordpress instances which were NOT initially installed ...
4
votes
1answer
5k views

wp-cli doesn't find and wordpress installation

I wanted to try wp-cli, downloaded the phar and installed it by moving it to ~/bin which is in my path. Then wp --info works, but maybe shows insufficient information. (e.g. no php path, though it is ...
1
vote
1answer
542 views

BackupBuddy WP CLI Invalid Profile Error

When I try to run a WordPress (3.8) backup of a site using wp-cli 10 alpha (site here) wp --info PHP binary: /usr/local/bin/php-5.3 PHP version: 5.3.5 php.ini used: /etc/php53/php.ini wp-cli ...
3
votes
2answers
1k views

How do I pass an array as an argument to a WP-CLI command?

I want to use WP-CLI to create some new posts with custom taxonomy terms assigned. The challenge is that wp_insert_post's tax_input argument only accepts arrays, which I would have to specify on the ...
3
votes
3answers
5k views

wp-cli displays php notices when display errors off

I am using wp-cli and I am having php notices and errors show up when running wp-export. Some of these warnings and errors are ending up in the output file. How can I force errors to NOT show up. I ...
-1
votes
1answer
1k views

Why can't the WP-CLI installer find my php.ini?

I am trying to install WP-CLI on my Mac using the standard installation command (found here: http://wp-cli.org), yet I am receiving the following error message: #!/usr/bin/env php Some ...
5
votes
3answers
2k views

How to use command 'wp post create' in wp-cli properly?

I need to create a single post with title, content and excerpt with this command as it's described in the utility documentation. Could you please show me an example of how to use it? I couldn't find ...
8
votes
4answers
2k views

Is there a drush equivalent for WordPress yet?

I'm working with Drupal on a project right now, and for all it's faults, having a commandline interface like drush to the Drupal framework is a godsend. Is there an equivalent for using Wordpress to ...