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.

learn more… | top users | synonyms

1
vote
2answers
23 views

Can I create multiple pages at once using WP-CLI?

I am new to WP-CLI and having trouble finding examples of what I want to do. I know how to create a single page. wp post create --post_type=page --post_status=publish --post_title='Contact' Is ...
3
votes
1answer
46 views

How to export WP database for import using WP-CLI on Vagrant Box?

Problem Now that I have a new environment with WP-CLI db import / export I need to import a database from a website that never had WP-CLI installed. Question What's the best Non-WP-CLI export ...
1
vote
1answer
13 views

WP-CLI not setting page template with page_template=“template-name.php”

I'm having trouble setting the page template with wp-cli. According to this post, How do I set and list page_template with wpcli, it looks like: wp post create --post_type=page ...
0
votes
0answers
28 views

WP-CLI mysteriously stopping while downloading the core

I'm jazzed about WP-CLI but for some reason when I run wp core download it says Downloading WordPress 4.4.1 (en_US)... and pauses for 20 seconds or so and then just goes back to the terminal prompt. ...
0
votes
1answer
18 views

Creating programmatically wp-cli create post with qtranslate [on hold]

How do I create a post having title, content for all the enabled languages ?
3
votes
2answers
49 views

Using Travis CI to run unit tests and running phpunit locally [closed]

Is there a difference between Travis CI running my PHPUnit tests and me using the WP-CLI to generate unit test files and running phpunit locally? I'm wondering if the duplicate effort is necessary or ...
1
vote
1answer
29 views

How can I replace all regex matches using the WP_CLI search-replace tool

With WP CLI I can use the search-replace method like this: wp search-replace 'foo' 'bar' However, when I use regex, it only replaces the first occurrence within each DB field: wp search-replace ...
3
votes
1answer
35 views

wp-cli: wp term generate xxxxx - Error: 'xxxxx' is not a registered taxonomy

I'm writing a WP CLI command which creates and updates taxonomies using wp_insert_term. Actions on my custom taxonomies are not accepted since they don't show up as registered. The wp-cli included ...
0
votes
0answers
40 views

WP does not recognize any plugin after defining 'WP_PLUGIN_DIR'

I'm trying to develop a plugin so I want to change the location of these defining the constant 'WP_PLUGIN_DIR' as follows: define('WP_PLUGIN_DIR', '/home/user/Projects/wp/plugins'); Running the ...
4
votes
0answers
37 views

Wp-cli-ssh global installation problem [closed]

Global installation of wp-cli-ssh returns following error: $ composer global require x-team/wp-cli-ssh dev-master Changed current directory to /Users/name/.composer ./composer.json has been updated ...
0
votes
1answer
49 views

wp-cli Enabling Maintainance Mode

During theme or plugin upgrades, maintenance mode is enabled and then disabled once complete. Is it possible to manually enable / disable maintenance mode? Enabling Maintenance mode... Downloading ...
2
votes
1answer
82 views

wp-cli with MAMP shows sh: mysql: command not found

I just installed wp-cli using homebrew and changed the PHP path in .bash_profile to below. export WP_CLI_PHP=/Applications/MAMP/bin/php/php5.6.10/bin/php export ...
1
vote
1answer
49 views

wp-cli: run post generate and post meta add together

I would like to generate a number of posts and attach the same featured image to all posts. wp post generate --count=20 wp post meta add <id> _thumbnail_id 215 But how can I run this two ...
0
votes
1answer
30 views

Correct file permissions for in-browser updates using WP-CLI

I installed WP using WP-CLI (i.e. on the command line on the remote server). I'd like to give another person the ability to change the theme, plugins, etc. using the standard WP admin browser ...
0
votes
0answers
38 views

WP-CLI :: Cannot installing plugin as www-data

Just started using WP-CLI and instead of running with --allow-root, decided to run as www-data user. Things are good so far but cannot install any plugin that way at all: ...
1
vote
0answers
30 views

WP-CLI not recognizing commercial plugin updates

I'm running into an issue I haven't encountered before where WP-CLI is not recognizing plugin updates for commercial plugins. The plugin updates appear in my WordPress dashboard, but running ...
1
vote
1answer
110 views

DataBase connection problem with PHPUnit and WordPress

I'm trying to run PHPUnit to unittest a WordPress plugin, but the error below keeps showing up. Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in ...
0
votes
0answers
76 views

Update BackupBuddy with WP-CLI

I've written a script that basically loops through all of the WP sites on our server and updates everything: core, plugins, themes. It does, however run into one issue: It will not update ...
0
votes
0answers
36 views

WordPress API - count posts

Is there a way to count the number of posts / pages via the WordPress API? I'm wanting to insert a post then check, using the API, that the count has gone up by 1. I've looked at ...
0
votes
2answers
51 views

WP CLI theme install. Install a private repo?

I have a bash script that installs and activates a theme like this: wp theme install https://bitbucket.org/organization/theme/get/master.zip --activate The problem is that it only works with public ...
0
votes
1answer
42 views

Using wp-cli can I not query pages by their title?

All of these do the same thing: wp post list --post_type=page wp post list --post_type=page --post_title=dfdsfds wp post list --post_type=page --title=sdfdsf How can I query the post by the title? ...
1
vote
1answer
283 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 ...
2
votes
2answers
230 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 ...
0
votes
0answers
72 views

WP-CLI without phar

I've been trying to get WP-CLI working on a server compiled with --disable-phar (probably for security reasons). Is there any way I can override this and get WP-CLI working anyway? These are the ...
1
vote
0answers
24 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 ...
0
votes
1answer
36 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 ...
3
votes
2answers
177 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
1
vote
1answer
251 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 ...
0
votes
0answers
21 views

After “wp export” from WP-CLI, Wordpress users cannot log in to the wp-admin

I was trying to export a xml file to test some things in a new production server. Here's my steps and the error that occurred: From the command line, in the root of the application: sudo wp ...
0
votes
0answers
126 views

Help With MultiSite SEO Problems

I really could use some help with setting up our MultiSite Network for SEO optimal results. Setup is like this: MultiSite installation setup as sub domains Hosted on a Pagely VPS with a dedicated IP ...
1
vote
1answer
351 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
1answer
88 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
37 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
135 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 ...
1
vote
1answer
317 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 ...
0
votes
0answers
70 views

wp-cli PHP warning “Unexpected character in input: '”

I start to get this warning in WP_CLI whenever I try any sort of command: PHP Warning: Unexpected character in input: ' in phar:///usr/local/bin/wp/php/wp-cli.php(23) : eval()'d code on line 40 ...
1
vote
1answer
134 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: ...
2
votes
2answers
993 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 ...
0
votes
1answer
101 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
34 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.
0
votes
2answers
237 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, ...
3
votes
2answers
883 views

How to run WP Cron the right way?

I have WordPress Multisite with several sites. I set up DISABLE_WP_CRON to true in my wp-config.php. How to run wp-cron.php the right way? If we set up cron task with wget or curl we have 30 sec ...
1
vote
1answer
82 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 ...
4
votes
1answer
173 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
323 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
395 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 ...
4
votes
1answer
750 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 ...
3
votes
2answers
1k 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
154 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 ...
6
votes
3answers
1k 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 ...