Questions tagged [wp-cli]

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.

Filter by
Sorted by
Tagged with
5
votes
2answers
495 views

WP-CLI Process Killed

I have around 1200 large images which I'd like to regenerate. I'm using the WP-CLI command wp media regenerate. After around 61 images are generated, the terminal shows the message Killed. Why is ...
0
votes
2answers
537 views

WP-CLI wp theme install url PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

I tried use wp-cli theme install with option url from my dropbox link. But unfortunately, I got this problem: PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature This ...
0
votes
0answers
17 views

wp cli search and replace on --network Error reconnecting to the database

I'm getting a new Vagrant VM WordPress setup. I've downloaded my production db and I normally I go through and use a search and replace to find a production url and change that to a local development ...
0
votes
1answer
2k views

PHP warning are displaying when using WP CLI

I'm running WP CLI 0.25.0 on Debian, PHP 7.0. I keep getting the PHP warnings displayed. In php.ini used for cli I have set error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING ...
2
votes
0answers
31 views

WP WPQuery, not running properly in WP CLI

I'm running a simple query just to find simple WooCommerce products, here is the query which works fine in the header of the site: $args = array( 'post_type' => 'product', 'posts_per_page' =...
0
votes
0answers
18 views

Is it possible to delete a range of posts by ID with WP-CLI?

I am in the process of learning WP-CLI and I typed in the command line mistakenly wp post generate instead of wp post generate --help Now I have generated the default 100 posts, however, this is a ...
1
vote
1answer
67 views

WP-CLI can't list posts

I have a WordPress Multisite (behind a firewall). I use WP-CLI for lots of things. But for some reason wp post list does not work. wp post get works. But wp post list always yields the same output, ...
0
votes
0answers
12 views

'wp-cli post generate' is creating missed scheduled posts

I am using the wp-cli to generate test posts. I ran the command wp post generate --count=20 --post-status=publish Now all my posts appear to have missed the schedule. When I add --post_date="...
2
votes
2answers
2k views

WP-CLI over SSH - wp command not found

I'm stuck trying to do the remote SSH with WP-CLI. I have installed WP-CLI on my Webfaction server and tested it's working # This is in server $ wp --info OS: Linux web561.webfaction.com 3.10....
0
votes
0answers
11 views

How to add custom post meta key:value in woocommerce using wp-cli

I am Using WooCommerce cli to create product but having issue to add custom filed (key:value in postmeta table) wp wc product create --name="Test Title" --description="Description goes ...
26
votes
4answers
16k 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
16 views

cli > why wp core update says it can't connect to db, while wp db can do it?

I've got a strange problem. The site is running properly, both back and frontend. I just want to update it via wp cli. wp core update It keeps saying Error: No such file or directory and that ...
0
votes
0answers
29 views

Can't Connect to MySQL Database using WP CLI and MAMP on a macOS Catalina, using Oh My Zsh

I'm running macOS Catalina and am trying to use WP CLI with MAMP, with iTerm2 and Oh My Zsh as my command line. However in my localhost directory when I enter wp in the command line, and then press q ...
0
votes
0answers
20 views

Rebuild thumbnails via WP Cli - how?

I can use wp media regenerate to regenerate thumbnails. But I need to rebuild first, before I can regenerate. In the GUI of WordPress I have two buttons (if I have AJAX Regenerate Thumbnails plugin): ...
0
votes
0answers
208 views

WP CLI in WP 5.3 with PHP 7.4

Working with the WP REST API WP-CLI in WP 5.4, by selecting PHP 7.3 the call to wp post works as usually: wp post list But changing to PHP 7.4 (current) throws me the following errors: Deprecated: ...
0
votes
1answer
42 views

Error establishing a database connection when running phpunit

I'm following https://make.wordpress.org/cli/handbook/plugin-unit-tests/ to run unit tests for plugins. I create a new plugin. $ wp scaffold plugin hello-plugin-1 Success: Created plugin files. ...
0
votes
0answers
16 views

WP-CLI: detect altered core files and restore them automatically

I know that there is a command to verify the integrity of the core files: $ wp core verify-checksums In case a file is corrupted or altered, is there any WP-CLI command to automatically restore all ...
0
votes
2answers
79 views

WP CLI allowed fields?

Very basic question, but I couldn't find an answer. I am using the WP CLI post get command: https://wp-cli.org/commands/post/get/ One of the option is [--field=], but I can't find in the doc the ...
0
votes
0answers
17 views

wp-cli import throws ERROR 1045 (28000) password error after changing DB password; wordpress and mysql work with new password

I'm Running Wordpress on a Bitnami VM. I updated the database user's password for my wordpress site. Everything except wp-cli works fine with that new password. Relevant part of wp-config.php looks ...
2
votes
3answers
372 views

Can I create (or update) user password with WP-CLI by hash?

I want to make a user-create snippet, but it must not includes plain password. $ wp user create username username@example.com --role=administrator --user_pass=password So can I create (or update) ...
0
votes
2answers
189 views

Set Site Icon programmatically (eg. using `wp cli`)

Wordpress has a "Site Icon" feature that serves correctly-sized favicons and so on to browsers. Is there a way to drive this feature programmatically, eg. by uploading media and setting an option with ...
0
votes
0answers
24 views

WP CLI: critical error on your website

I want to use the cli to update my wordpress instance. Unfortunately, I alwas get the "critical error on your website" message. I've already checked the error.log of my webserver and also the debug....
1
vote
1answer
492 views

Error updating WP-CLI

Below is the output from my attempt to update wp-cli on Windows 10. Clearly another version is available. Can someone please explain how to make this work? C:\Users\HP>wp cli update Error: You can ...
0
votes
2answers
95 views

How to run wp cli from a wp hook?

How can I run a wp cli command when a wordpress hook is called on my website. On user registration hook, I would like to run a wp cli command to activate a license.
1
vote
2answers
571 views

Is it possible to use WP-CLI via PHP-framework?

I have Zend framework 2 application (PHP), via which I want to use WP-CLI functionality. near Zend project I have WordPress project, which I want to maintain from Zend via WP-CLI. I see in the docs ...
3
votes
2answers
3k views

WP-CLI Bulk delete posts from specific category

I would like to know how to bulk delete posts from a specific category using the WP-CLI, any tip?
3
votes
3answers
2k views

How do I clone or duplicate a post with the WordPress Command Line Interface WP-CLI?

I know that I can clone or duplicate a post with several plugins. The one I use most often is https://wordpress.org/plugins/duplicate-post/. However I am using the WP-CLI more and more lately and I ...
5
votes
2answers
473 views

How to reset passwords for all users on a network using wp cli

I have a WP Network (sub directory), Sometime specially in case of security emergencies, it is generally preferred to change passwords for all users. I am looking for a way to reset passwords by ...
0
votes
0answers
33 views

wp-cli setting home and siteurl to site.tldtld (double TLD)

I'm installing Wordpress with wp-cli. The installation works without failure but it's setting siteurl and home to http://cbdhut.homehome. The command I'm running to install are: cd ${webroot} ./wp....
2
votes
0answers
105 views

WP CLI: there has been critical error

I am using Wordpress 5.3 minimal installation and currently have not installed any other plugins. I have installed WP CLI and below is the output of wp-info: OS: Linux 5.0.0-1025-gcp #26~18.04.1-...
0
votes
0answers
12 views

wp cli import media adding 10 files for each media files on disk. is it a bug?

I copied some files to my server; Then I ran: wp media import *.jpg Then in wordpress > media-library, there are 10 different sizes for each file, EACH size has its own entry in the media library. ...
10
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 its faults, having a command line interface like drush to the Drupal framework is a godsend. Is there an equivalent for using WordPress to ...
2
votes
1answer
74 views

Is there a way to pre-cache plugins with WP-CLI for faster installation?

So I can cache a WordPress installation with: wp core download --version=4.5 --path=/tmp/wp45 Subsequent requests of version 4.5 will be pulled from wp-cli local cache. I think that: wp plugin ...
0
votes
1answer
42 views

WP-CLI plugin activate - 'activate' is not a registered subcommand of 'plugin'

I just downloaded the latest version of WP-CLI bundle to my Mac and now this WP-CLI plugin activate XXXXX doesn't work. It gives me the message wp plugin activate XXXXXXX 'activate' is not a ...
2
votes
1answer
28 views

Ask WP-CLI latest core WordPress version released

I'm trying to make a script (bash) that examines all WordPress installations on my server and returns a set of information. I would need to know the latest known version of WordPress (official ...
1
vote
0answers
65 views

Save (same) permalink from wp-cli

I moved many WordPress sites to a new server and all permalinks need to be "refreshed". I need to save again (without any changes) settings->permalinks to resolve pages/posts 404 error. I ask if it ...
3
votes
1answer
132 views

How can I run a WP-CLI command as authenticated user?

I've written a command for wp-cli called wp nurse. It is styled after the wp doctor command, except is meant to run the WordPress Site Health checks. Using the in-browser tool, all 16 tests currently ...
4
votes
1answer
341 views

WP CLI info showing correct PHP binary but wrong version of PHP

When a run a command such as wp plugin update I get the message: "Your server is running PHP version 5.4.13 but WordPress 5.2.2 requires at least 5.6.20" I don't even have PHP 5.4 installed in my ...
1
vote
1answer
37 views

Where do the files of a custom WP CLI Command reside?

I want to create a custom WP CLI command and I have read the documentation but I just don't understand for the life of me how this works. Do I need to declare it before in my config file where they ...
4
votes
1answer
160 views

Does wp post delete also delete metadata associated with posts?

say this: wp post delete --force $(wp post list --post_type=product --format=ids) I found out that it's far more fast and performant than deleting posts from admin. But I was wandering: any ...
0
votes
0answers
44 views

WP-CLI works for all installations but one

I have the latest wp-cli installed on Windows 10 Pro. Running WP locally on laragon. For all installs, I've got it to work nicely, but at one of them, any wp-cli command except wp --info doesn't do ...
0
votes
0answers
78 views

WP-CLI regex - search-replace match specific tags and any characters in between

I am using WP-CLI regex to replace specific tags and the content within the tags. Note that the content between the tags is dynamic so can change. I want to replace everything between [vc_row ...
2
votes
1answer
141 views

Remove all users from site except one using WP CLI

I would like to remove all users from WordPress site using WP CLI except one (me, as administrator). This command remove every user: wp user delete $(wp user list --field=ID --number=10) ...
11
votes
2answers
1k 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 ../wp-...
1
vote
0answers
139 views

How to delete 1000s of duplicated images in Wordpress?

We kinda have a wired problem that took me weeks of searching and testing, the problem is that while working on one of my client's Wordpress website I noticed that there are around 75k images in ...
7
votes
1answer
4k 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
80 views

wp-cli wp media regenerate --only missing deletes unused sizes?

I just ran wp media regenerate throught 200k images... thing is I have 400k, and the range command is not working (200000 400000 | xargs ***) If I use wp media regenerate --only missing will it ...
0
votes
1answer
190 views

wp-cli core install unknown: fatal: file /etc/postfix/main.cf: parameter mail_owner: user postfix has same user ID as _postfix

I'm trying to setup two wordpress virtual hosts on my macbook using a shell script composer and wp-cli. The first virtual host has been working perfectly. When I run the script for the 2nd virtual ...
4
votes
1answer
121 views

Difference between deactivating, uninstalling, and deleting plugins

I understand the difference between deactivation and uninstallation. But the CLI also has a delete option. How does it differ? To be safe, should I deactivate, then uninstall, then delete?
13
votes
7answers
9k views

WP CLI “Error establishing a database connection” in localhost (MAMP)

I get this error when I try to create something with WP CLI: Error establishing a database connection. This either means that the username and password information in your `wp-config.php` file is ...

1
2 3 4 5 6