Questions tagged [wp-cli]

wp-cli is a command line interface for WordPress.

wp-cli is a command line interface for WordPress.

You can easily install and update WordPress core, plugins, themes, and more. There's an active development community and additional commands are added regularly.

wp-cli is similar to drush, a tool for Drupal.

Document Source: http://codex.wordpress.org/wp-cli

197 questions
0
votes
0 answers

wp-cli error "/usr/bin/env: «mysql»: No existe el archivo o el directorio"

I'm trying to use wp-cli on Ubuntu and I'm using Xampp to run WordPress, but every time I try run this command: wp core config --dbname=demo-1 --dbuser=root --dbpass=hola --dbhost=localhost --dbprefix=wp_ --extra-php <
EdT
  • 1
0
votes
1 answer

Using wpcli on wordpress docker-compose installation

Im developing a wordpress theme which running on local with docker-compose. This was my docker-compose file: version: '2' services: mysql: image: mysql:5.7 restart: always ports: - 32787:3306 environment: MYSQL_USER:…
Lorraine
  • 441
  • 5
  • 23
0
votes
0 answers

How to connect wordpress install and cli docker

I am having great trouble with this, Trying to add wp cli to my wordpress installation with docker-compose but cant get it done as im getting an error when trying to connect the two in docker compose - IM getting an error about duplicate…
0
votes
1 answer

How to make arguments compulsory in WP CLI command

I want to use WP CLI to delete the WooCommerce orders. I have 3 arguments ( product_id,start_date,end_date ). How do I check all 3 arguments are passed in command or not ? How do I do something like this ? if ( ! empty( ALL THE ARGS ) ) { …
Parthavi Patel
  • 739
  • 11
  • 28
0
votes
0 answers

How to install wp cli on mac

I am running this command on my mac machine: curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar But I got this error: Warning: Failed to create the file wp-cli.phar: Read-only file system What should I do?
Shibbir
  • 1,963
  • 2
  • 25
  • 48
0
votes
0 answers

Trying to pass arguments to wp-cli in a bash script

I'm using a wp-cli tool in order to optimize images: $ wp image-optimize batch --limit=20 I've installed wpcli using composer so it's in an unusual location, but is in my $PATH: /home/user/.config/composer/vendor/wp-cli/wp-cli/bin/wp This works…
JJ67
  • 1
0
votes
1 answer

multi line variable does not work for parameters when used in a bash shell script

I have a script that is used to set up a couple default widgets on a wordpress site through wp-cli. script widgets.sh: read -r -d '' TEXT << EOM Line1 Address Phone: 555-x E-mail: so@you.say EOM sudo --user=$USRNAME -s wp…
Ronin
  • 65
  • 1
  • 9
0
votes
2 answers

Error on ansible playbook installing WordPress with wp-cli

I'm using an ansible playbook (ansible ver. 2.9) to install WordPress using wp-cli tool. Here's the playbook: - name: Create WordPress database mysql_db: name="{{ db_name }}" state=present login_user=root …
Roberto Jobet
  • 153
  • 4
  • 15
0
votes
1 answer

Wordpress CLI “Warning: Some code is trying to do a URL redirect.” error

I'm using WP CLI to manage the cron tasks of my Wordpress installation. Was working well, but now I'm getting the error: Warning: Some code is trying to do a URL redirect. Backtrace: #0 WP_CLI\Utils\wp_redirect_handler(https://example.com.br)…
0
votes
1 answer

Install plugin with wp-cli in a CI environment

I'm trying to install the w3-total-cache plugin in a wordpress docker image with the wp-cli, but it seems to try to connect to the database, even tough I don't try to activate it. In the Dockerfile I install other themes/plugins with composer and…
Lucas Basquerotto
  • 7,260
  • 2
  • 47
  • 61
0
votes
1 answer

Nesting if-then statements with wp-cli variables

I am using wp-cli and bash scripting to change WordPress home and siteurl database entries on multiple websites and want to automate it universally with this script. I normally just change it with either wp option set home or just a global…
0
votes
0 answers

Installing wp plugins after image builds

I'm trying to install wp plugins by executing script right after the wordpress image is built. Here is my Dockerfile: FROM wordpress # Update aptitude with new repo RUN apt-get update # Install software RUN apt-get install -y sudo vim curl less…
Lance
  • 1
  • 2
0
votes
2 answers

wp-cli search-replace not replace when using regex

I'm using the following command to remove [download id="XXXX"] patterns: wp search-replace '\[download id="([0-9]+)"]' ' ' wp_posts --regex --regex-flags='i' But it didn't replace anything.
marcelo2605
  • 2,734
  • 4
  • 29
  • 55
0
votes
1 answer

what is the url for wp core install --url for kubernetes?

In kubernetes, I have a wordpress container and a wp-cli Job. To create the WordPress tables in the database using the URL, title, and default admin user details, I am running this command in the wp-cli Job: wp core install…
saragit
  • 43
  • 1
  • 6
0
votes
1 answer

Prevent wp-cli from writing gzip'ed stream to stdout when called from bash script in Apache context?

This is a Wordpress site on a shared hosting provider. There is a 3rd party plugin which will manage a staging site. Most of the heavy lifting is done with a bash script which makes a lot of calls to wp (wp-cli). When I run wp from the command line…
tlum
  • 913
  • 3
  • 13
  • 30