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
1
vote
1 answer

WP-CLI list posts by multiple meta values

I want to list out posts by querying multiple meta data's in order to pipe them into an xarg wp post delete --force --defer-term-counting Eg. $meta_query = array( 'relation' => 'AND', array( 'meta_key' => 'first_key', …
1
vote
1 answer

Errors while replacing adresses on localhost xampp Error: There has been a critical error on this website.Learn more about debugging in WordPress

Errors i get while replacing: First: Error: There has been a critical error on this website.Learn more about debugging in WordPress. There has been a critical error on this website. Second: Fatal error: Uncaught TypeError: unserialize(): Argument #1…
urodii
  • 11
  • 1
1
vote
1 answer

How iterate over wp options list output using bash?

I want to create a script that adds WordPress options in a fresh WordPress installation using WP-CLI. I ran this command wp option list --format=json | jq -c -M '.[]' The output of the command like…
Nurdindev
  • 173
  • 1
  • 12
1
vote
1 answer

WP CLI Claims DB Needs Repairing but WP Itself Works

I use wp-cli in my deploy/upgrade script. I'm currently getting the following error from wp core is-installed (first command my script does with wp cli) Error: One or more database tables are unavailable. The database may need to be repaired. So I…
Adam
  • 6,539
  • 3
  • 39
  • 65
1
vote
0 answers

OpenSSL / LibreSSL issue on Mac - dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

I did a brew update && brew upgrade to try and fix a problem (stoopid!!) and now I get various forms of: dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Referenced from: /usr/local/opt/mysql@5.7/bin/mysql Reason: image…
Narkanister
  • 814
  • 1
  • 7
  • 13
1
vote
1 answer

WP_CLI - how to get / set path

I've installed WP-CLI but it says "This does not seem to be a wordpress installation". The wp keyword works. So I set path: wp --path '/home/somefolder/okay/websitefolder' But then it says "No Wordpress installation found". It also says…
Galivan
  • 4,842
  • 9
  • 44
  • 76
1
vote
1 answer

How to use a wordpress container with a wp-cli container when /var/www/html is already mounted in the host?

I tried using networks, but the network with the folder's name concatenated with "_default" is not found. If I specify the network like this: wpcli: container_name: ... image: wordpress:cli working_dir: /var/www/html depends_on: …
silviubogan
  • 3,343
  • 3
  • 31
  • 57
1
vote
1 answer

WordPress Plugins and Themes not working with WP-CLI and Docker Compose

I've connected my wpcli container to my wp container, but only some functionality works. I can edit posts, menus, etc., but themes and plugins are not working. If I run docker-compose run --rm wpcli wp theme list or docker-compose run --rm wpcli wp…
Rice_Crisp
  • 1,242
  • 1
  • 16
  • 33
1
vote
1 answer

Execute WP CLI commands in PHP script

To do this, I copied the repository WP CLI into Root WordPress And I wrote the following PHP code to encode it and encountered the following errors define('WP_CLI_ROOT', ABSPATH . 'wp-cli'); require_once WP_CLI_ROOT . '/php/wp-cli.php'; Warning:…
1
vote
3 answers

Change the homepage in WordPress with CLI

How to change the homepage in WordPress via CLI. e.g I have one page called "Home1" and I want to make that page the homepage. In other words, I want to change the "Static Page" via CLI.
3UMF
  • 5,162
  • 2
  • 15
  • 26
1
vote
3 answers

WP-Cli wc product create Custom attributes

Good day, I'm using the wp-cli for adding products to Wordpress, for example i use this one: wp --allow-root wc product create --user=1 --name="Restricted" --regular_price=1 I do have some attributes called test_1 (checkbox for yes) and test_2 is…
Ronn0
  • 2,249
  • 2
  • 21
  • 36
1
vote
1 answer

How can I see the number of maximum open files in PHP?

With PHP I'm running into failed to open stream: Too many open files errors, thru wp-cli as well as through fpm-php. I've adapted things like fpm's rlimit and ulimit on the command line. Now it would be really nice if I can see the maximum number of…
the
  • 21,007
  • 11
  • 68
  • 101
1
vote
1 answer

I cannot activate or deactivate plugins in wp-admin area or using wp-cli

I have a problem on a client's live WordPress site where I am unable to activate or deactivate plugins. I am an administrator and used to be able to do this. I can add new plugins but not activate. I'd be grateful for any insight into what I can try…
Anita
  • 13
  • 4
1
vote
0 answers

What is correct path to WP_CLI library to require_once?

I am trying use require_once ('...'); to create class extended WP_CLI_Command. I have installed wp-cli.phar by: curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar after php wp-cli.phar --info OS: Linux…
Tomasz
  • 1,368
  • 3
  • 17
  • 31
1
vote
1 answer

How to have wp-cli commands work in a bash script from cron

I have a bash script with various WP-CLI commands to run a backup, check & optimize db tables, run a security vulnerability check, check available core, plugin, and theme updates, and then email the report to me. If I run this script from the…
cinemafunk
  • 73
  • 7