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

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.

1
vote
3answers
141 views

Change old URLs after the domain change

I have setup wordpress on my server, and after some time I've changed the domain name of the installation. However, all of the old urls within the site point to the old domain. How can I change old ...
0
votes
0answers
25 views

I can not update fields with the tax_input tag using wp cli

i'm using this command for update in command line using wp-cli tool. wp post update 12349 --meta_input='{"opalestate_ppt_parking":"2"}' --tax_input='{array('opalestate_statuschecklist' => 'rent')}'...
1
vote
1answer
863 views

WP CLI not importing media files

When I tried on localhost, it appears media files are imported. When I tried on real server (AWS LightSail) seems like images are not imported why might it be? I did not ask it to --skip The main ...
0
votes
0answers
12 views

Unit test for wordpress plugin

I have followed wordpress office blog -->https://make.wordpress.org/cli/handbook/plugin-unit-tests/ to implement unit testing in plugin. I have been able to write a simple test on one of my method of ...
0
votes
2answers
44 views

XDG-OPEN is not recognized by WP CLI admin command

So i installed the wp admin package, but i can't seem to get her working, an error pops up telling me xdg-open doenst exist.. For install i used: wp package install git@github.com:wp-cli/admin-...
0
votes
0answers
17 views

Can run cron event manually with WP-CLI but not with any plugin, unsure if it's being scheduled

I have a cron event that I am able to manually run with wp cron event run --all When I go to my dashboard and go to WP-Crontrol OR Advanced Cron Manager, I can see my event listed and tell it to ...
1
vote
2answers
26 views

How to specify to wp-cli for the `wp config create` (`wp core config`) command that the DB user is an 'all hosts' user?

My wp config create command: wp core config --dbname=wordpress --dbuser=wordpress --dbpass='this is not the real password' Running it: $ wp core config --dbname=wordpress --dbuser=wordpress --...
1
vote
1answer
414 views

How to clear Transients on all sites in Multi Sites environment

I know we have the following command available in WP-CLI to remove transients # Delete all transients $ wp transient delete-all However, my question is does it remove transients on all sites over ...
2
votes
1answer
28 views

In a continuous integration environment how do you implement the database entries for plugins and themes

I'm setting up a wordpress continuous integration environment - git->composer->bitbucket-AWS codepipeline, etc. I have yet to figure out how I automate, for the development team, the setup of the ...
0
votes
0answers
32 views

wp-cli media regenerate --all results in a 'Killed' message

Was having issues with the 'Regenerate Thumbnails' plug-in as well. Perhaps the same root cause. All plugins, core, etc up to date. On Bitnami Nginx from the AWS marketplace. I DO have some fairly ...
1
vote
1answer
40 views

Different output from WP-CLI in bash vs PHP exec()

I installed this package on WP-CLI. When I run wp login create in bash it works fine, but when I run exec("wp login create") in PHP script WP-CLI return this error: Error: 'login' is not a ...
0
votes
1answer
22 views

Uninstall WP-CLI

I have WP CLI installed on my server. Is there a command to uninstall the package? Here's where it's been installed on my server: I'd rather uninstall the package vs using rm -r.
0
votes
0answers
17 views

How to create a gallery using WP CLI?

I am hoping someone has some insight into how to create a gallery using WP CLI. Or at the very least get the IDs for the images imported using "wp media import". I've tried using --porcelain but it ...
0
votes
0answers
26 views

Can't install local plugin (zip) with wp-cli

I'm using WP-CLI with Docker, everything works fine but I can't seem to find a way to install plugins that are on my local drive. I'm following the instructions, and do : wp plugin install ../assets/...
0
votes
1answer
50 views

Install plugin on remote wordpress

I want to install a plugin using wp-cli (or anything else) on a WordPress based website. I have URL, admin-user, admin-pass only. (no FTP/ssh). I want to do it programmatically, without going into the ...
0
votes
0answers
25 views

WP-CLI is unable to update password

I execute following command to change password for admin user from command line: wp user update admin --user_pass="mynewpassword" --allow-root I got following error message: WordPress database ...
0
votes
4answers
673 views

Get media url (featured image) with wp-cli

I am attaching an image to a post with the media import command. I know I can get the image id using the --porcelain option, but how can I get the image url from this id? Or is there a way to ...
0
votes
0answers
17 views

Faster Unit Testing in WordPress?

I'm using WordPress Unit Testing to develop a plugin. The Unit Testing is the one provided by WP-CLI with the wp scaffold plugin-tests command: https://make.wordpress.org/cli/handbook/plugin-unit-...
1
vote
0answers
31 views

WP-CLI cron on multisite using WP-Toolkit “succeded”, but callback not executed

I'm trying to trigger WordPress crons within a multisite using Plesks WordPress toolkit. Generally it is working, but the callback doesn't seemed to be executed. The command to execute crons: /...
0
votes
1answer
33 views

Can I use wp-cli to create posts with a custom post types?

I regularly need to create a batch of posts of a custom post type, with names and meta values that follow a regular pattern. This seems like a perfect canditate for using wp-cli, but so far it hasn't ...
0
votes
1answer
83 views

Trying to install Wordpress on WSL Windows 10, and running into issues with wp-cli and “wp db create”

Okay so I'm following this tutorial: https://hellojason.net/blog/how-to-setup-wordpress-locally-on-windows-subsystem-for-linux/ I had to do a bunch of monkey around to get MySQL to work because for ...
1
vote
0answers
23 views

How to change user admin_color with WP CLI?

I like to know how I can change a users admin color theme with WP CLI.
5
votes
4answers
1k 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 ...
0
votes
1answer
23 views

Is it possible to use WP-CLI in a plugin (or theme)?

Is it possible to use WP-CLI in a plugin (or theme)? Such as $ret = \WP_CLI::execute('plugin list'); I want to use some subcommands from other plugins.
0
votes
1answer
27 views

How to activate an mu-plugin with wp-cli

Do I need some extra WP-CLI bundle to activate mu-plugins via command line? I can't find anything about that in the docs. Are mu-plugins treated differently by WP-CLI? I created /wp-content/mu-...
1
vote
1answer
106 views

Configuring WP-CLI on Windows 10

I've installed php5-cli using bash, but Wordpress is using XAMPP's PHP 7 install. I've added /mnt/c/xampp/php to the PATH, and I've explicitly used export WP_CLI_PHP='/mnt/c/xampp/php' in .bashrc. ...
2
votes
1answer
467 views

WP-CLI get all posts from certain post type and taxonomy term

I am trying to select all the posts from certain post type and term in custom taxonomy, but what ever I try gets me just the list of all the posts in certain post type wp post list --post_type=custom-...
2
votes
1answer
426 views

Can wp-cli display all users and their roles across all sites in a multisite instance?

List Multisite Users Using wp-cli(1) If I run wp user list I get a list of the users (2 admins in my case) at the top level of multisite(2). List Multisite Sites' Users I have 25 sites with various ...
0
votes
0answers
43 views

WP-CLI with cPanel WHM root, where users do not have shell access

I'd like to run wp-cli for a bunch of WP installs that live in separate cPanel accounts, all under a WHM with root. System is CentOS6. I'd rather not give the user accounts shell access. Wp-cli ...
0
votes
1answer
48 views

Running WP-CLI without SSH

This documentation says it is possible to connect wp-cli with website is possible with-out SSH : https://danielbachhuber.com/tip/wp-cli-without-ssh-access/ But i am not able to understand how it's ...
0
votes
1answer
133 views

ignoring, hidding mu plugins when wp-cli is run

wp-cli & a mu plugin don't get along causing the following error: "Fatal error: Call to a member function getAdminOptions() on null in /wp-content/mu-plugins/mobile-smart-proMU.php" Line of ...
3
votes
3answers
2k views

WP-CLI - Selecting PHP version

On a development server I have a co-install of PHP 5.6 & 7; nginx is configured with PHP 5.6. When I type "wp" it returns several errors and at the end of the error is a message containing the ...
1
vote
1answer
29 views

wp-cli: For development, how can I activate a theme that is on the local disk but not zipped?

I am developing a WP theme which I'm referring to as foobar for the sake of this question. It's located in /var/www/html/wp-content/themes/foobar. At the moment, I am activating it via wp-admin ...
0
votes
2answers
29 views

WP CLI can't delete plugin related table

I have installed a plugin following wp plugin install ... CLI command and then activate through CLI command its working properly. But problem is that when I deactivate then delete the plugin the table ...
-1
votes
1answer
53 views

Install WordPress using PHP

I just want to download, install and setup WordPress using PHP. I can do it using WP-CLI and command line and it worked. Now I want to do it using with WP-CLI and PHP. I read Run WP-CLI using PHP ...
2
votes
1answer
93 views

Safe to set permissions to 757 temporarily to update via wp-cli?

LEMP stack on digitalocean VPS. I haven't been able to get "wp core update" to work unless public (or "Other") has execute permission, i.e. 757 or 777. Otherwise, it throws "Error: Could not create ...
2
votes
0answers
94 views

wp core install database connection error

I am new to wordpress but not to programming to please bear with me. I am trying to get a new wordpress project up and running locally using the wp-cli. But when I run the following command: wp core ...
1
vote
1answer
38 views

Lock User and Enforce Password change via wp-cli

Via wp-cli I want on automated installation scripts to either: "lock" and send an email to enforce to follow a "forgotten password" link via a custom email. Enforce a user on first login to change ...
0
votes
1answer
39 views

Userless db-only wordpress instalation

Hello how I can perform a wordpress installation without the need to create users. I want to just run a command and just install the database. I want the user to get installed via gui when cli install ...
1
vote
1answer
37 views

Allow download_url for lan addresses

I'm hosting a wp site on my own server (at home) and I would like to use wp cli to import media from my own computer. On my computer, I have a web server and I asks to wp-cli to import media from "...
0
votes
1answer
41 views

WP Cli - post add meta in xargs after wp post generate - add multiple fields

This command will generate posts and create a field with key "bar" and value "foo" wp post generate --format=ids --count=10 | xargs -d ' ' -I % wp post meta add % foo bar This does not seem to work: ...
1
vote
0answers
100 views

How to use wp db export and import together?

When I use WP-CLI I'm having some issues with the wp db export and wp db import commands. I have a local site on my desktop that I would like to migrate to my laptop so I can work on it. So I go on ...
0
votes
1answer
243 views

Bulk remove custom post type and its attachments with wp-cli?

I have a custom post type called "meetings" and I will like to bulk remove all the posts and all of its attachment images... Can this be done with the wp-cli? thank you!
0
votes
4answers
309 views

What's the proper way to setup WP-CLI on Ubuntu so that I don't have to use the flag --allow-root?

I have an Ubuntu server, typical LAMP stack with default www-data as the user / group under which Apache serves files. When updating with WP-CLI I always have to type --allow-root flag. How do I ...
0
votes
0answers
17 views

Limit a user only to wp-cli only use

I have developed a docker wordpress solution and it uses wp-cli to do the required installation from shell. The installation itself required a user to get generated therefore I create a default admin ...
0
votes
1answer
42 views

Automate WordPress website setup with prefilled data

I'm asked to write documentation explaining how to set up a website to run exactly as the live environment does right now. The website is dependent on WPML, certain categories and menu's being ...
0
votes
0answers
114 views

How to get WP-CLI to work with bash scripts?

I have wp-cli installed on a WHM/cpanel server running multi-php versions with EasyApache4. I am able to use wp-cli when Im either in the directory where wp-config resides or I use the –path command ...
0
votes
0answers
23 views

Updating category ID using wp cli search-replace

I was wondering if search-replace using the old ID and the desired ID will work on a category and its relations. In order to avoid conflicts, would it be better to limit this at specific tables? I ...
0
votes
0answers
21 views

How come there is no error if I upgrade WordPress core after locking .htaccess permissions to 644?

How come there is no error if I upgrade WordPress core after locking .htaccess' permissions to 644? I upgrade WordPress this way basically: wp plugin update --all wp core update wp language core ...
0
votes
0answers
11 views

WP CLI Update Payment Gateway Settings Doesn't Save

I can enable payment gateways with below command: wp wc payment_gateway update paypal --user=1 --enable=true path=/www #This works well However, when I try to update a setting of the gateway, it ...