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
0 votes
1 answer
16 views

'wp' is not recognized as an internal or external command, operable program or batch file

I can't get WP-CLI to run on Windows. Downloaded https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar to c:\wp-cli\wp-cli.phar, Added c:\wp-cli\ to the System & User Path ...
Steve's user avatar
  • 1,698
0 votes
1 answer
45 views

What is the correct way to implement wp-cron server-side in Kubernetes?

I'm not sure if this is the correct place to ask the question, but since this is specific to deploying WordPress, I thought I'd ask here first. What is the correct way to implement wp-cron server-side ...
JakGuru's user avatar
0 votes
0 answers
20 views

Transitioning a big blog to WEBP images

I have a Wordpress site with a LOT of posts that still get significant amount of traffic (10,000's of posts). The site is image heavy and uses <img> tags for inline Jpegs as featured and inline ...
gravy's user avatar
  • 157
1 vote
1 answer
66 views

Batch Replace URLs in Wordpress Database

I will be using this command with WP-CLI to batch change about 1,000 URLs. while IFS=, read orig new; do wp --dry-run --skip-themes --skip-plugins search-replace "$orig" "$new" ...
JoaMika's user avatar
  • 650
1 vote
1 answer
61 views

wp media regenerate says "no regeneration needed" whe that's no the case

I'm trying to generate thumbnails for a PDF attachment. Right now in the uploads/ folder there is only the PDF file, no image thumbnails related to it. But when I run the regeneration with : wp media ...
mike23's user avatar
  • 5,933
0 votes
1 answer
21 views

Disappearing plugins

I've had a problem with disappearing plugins lately. Several of my plugins are installed and are working, but you can't see them in the admin plugin interface, only WP-CLI. The plugins are "...
scott8035's user avatar
  • 200
0 votes
2 answers
27 views

Post Count for Multisite?

Is there a way to get post count for all active sites on a multisite, using WP-CLI? Conceptually, I'm looking for a combination of wp post list --format=count and wp site list --format=count but I don'...
whakawaehere's user avatar
0 votes
0 answers
68 views

is it possible to use wp cli to export custom post types

i have been trying to use WP CLI to export custom post type 'product' from custom taxonomy 'product_brand'. however, my command is exporting a random list of products, from other brands. it also is ...
challenge2022's user avatar
0 votes
1 answer
36 views

wp cli media commands not working

I am trying to bulk update media file captions through WP CLI so i can attribute image creators. My command is as follows: wp media list --date="2022-02-24" --format=ids | xargs -n 1 wp ...
challenge2022's user avatar
0 votes
0 answers
18 views

Why doesn't "wp db cli" enable tab completion?

I would like to use tab completion when using the MySQL REPL accessed by running wp db cli. However it doesn't seem to work, even though my ~/.my.cnf file contains this content: [mysql] auto-rehash ...
Flimm's user avatar
  • 642
1 vote
0 answers
24 views

Why not attaching images after impoting using wp cli

I want to move posts from one site to another, because of the big amount of posts I am trying with wp-cli import. The destination site also has huge amounts of posts, now when I am importing XML files....
Mi2's user avatar
  • 11
2 votes
0 answers
137 views

Using wp-cli on remote with quoted commands

I have my wp-cli.yml configured with a working ssh connection. If I wp db query "CHECK TABLE $(wp db tables | paste -s -d, -);" and run locally it works just fine. On the other hand, if I wp ...
Tom Ransom's user avatar
-1 votes
1 answer
109 views

Weird WP -Cli Error Connection Refused

I have a rather of wp-cli problem. I am using wp-cli to import a db from my test server into my staging server and even though the import is successfully and everything seems to be working correctly ...
mjones's user avatar
  • 153
0 votes
1 answer
60 views

Can WP-CLI modify database connection details in existing wp-config file?

I am aware of WP-CLI's many database interaction functions via "wp db" and its functions for generating wp-config files via "wp config" - However I cannot find a way of using WP-...
mayersdesign's user avatar
1 vote
1 answer
81 views

Does DISABLE_WP_CRON prevent plugins from registering new cron tasks?

If I set DISABLE_WP_CRON to true in my wp-config.php file, then will it block plugins from registering new cron events (eg with calls to wp_schedule_event()) define( 'DISABLE_WP_CRON', true ); I've ...
Michael Altfield's user avatar
2 votes
1 answer
46 views

How to install WordPress with Composer?

I want to install WordPress and WP CLI both with Composer. This is how I install Drupal and Drush (Drupal's CLI tool) with Composer: cd WEB_APPLICATION_ROOT composer create-project drupal/recommended-...
yoine's user avatar
  • 21
1 vote
0 answers
45 views

wp-cli output 'column display format' / wrapping

First of, I'm not sure what the correct technical name is for this. The problem is the display width for the first column (or maybe total table width) on commands like wp plugin list and it outputs ...
piet's user avatar
  • 111
0 votes
0 answers
44 views

WP-CLi Uable to Install / Update Plugins

From the command WP-Cli is unable to install or update plugins, throwing the following error: The package could not be installed. "PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir ...
mjones's user avatar
  • 153
0 votes
1 answer
34 views

wp-cli incorrectly believes a plugin is currently installed

I ran wp plugin deactivate woocommerce --uninstall and it did so successfully. I verified with #ls wp-content/plugins the woocommerce folder no longer exists. Problem: when I run wp plugin install ...
mjones's user avatar
  • 153
0 votes
0 answers
45 views

WordPress CLI isn't working while use WordPress development repository

I cloned the repo from https://github.com/WordPress/wordpress-develop.git After that followed the README file from the downloaded code and installed node dependencies and execute the below commands in ...
Ashok Dhaduk's user avatar
1 vote
0 answers
55 views

Remote Export DB w. WP-cli.phar Over SSH

I am trying to export a remote wp db using the following: source_gzip_db=git-dumps/export.sql.gz source_path_to_wordpress=/home/username/public_html source_ssh_host="123.456.789.12" ...
mjones's user avatar
  • 153
0 votes
0 answers
21 views

Setting stock levels to "0" for all products in store using WP CLI

Is there any way to manually update the product statuses as "0". At the moment I am using WpAllImport + WpAllExport and it looks like WpAllExport generates a file with the current list of ...
Jacek's user avatar
  • 1
0 votes
0 answers
52 views

WP-CLi PHP Warning: mysqli_query(): (HY000/1356): View During Search Replace

I am on Ubuntu server, LAMP, WP6.01, with php7.4-fpm. I just extracted a number of sites from the same multisite installation and during the wp-cli search and replace command to replace the urls and ...
mjones's user avatar
  • 153
0 votes
0 answers
143 views

POT file generated using WP-CLI does not retrieve strings from translation functions with FQN (Qualifier)

I am generating .pot files by using the WP-CLI command above: wp i18n make-pot ... It works well, but it does not retrieve strings from translation functions with FQN (Qualifier). Example: \__( 'This ...
Michel Moraes's user avatar
0 votes
1 answer
146 views

When might you need to specify the "url" argument/option in WP-CLI?

I have read several blog posts and discussions about the url option in WP-CLI and have seen many different opinions and interpretations, so I assume I'm not alone with this question... The official ...
Jesse Nickles's user avatar
0 votes
1 answer
25 views

What is the purpose of the "user" global parameter in wp-cli.yml config?

According to WP-CLI documentation, you can specify "user" using inline arguments, or in the global configuration. I understand there might be a task you want to run against a specific ...
Jesse Nickles's user avatar
0 votes
0 answers
78 views

WP-CLI Add category as menu item main-menu

I've found this documentation about adding terms using WP CLI: https://developer.wordpress.org/cli/commands/menu/item/add-term/ and tried to find out how I can add an existing category to the main-...
stefantriep's user avatar
0 votes
0 answers
26 views

WP-CLI: Does "wp post create" will create post normally and will ping to Ping Service?

Is post created using WP-CLI is just a normal post that will ping to Ping Service? I scared if Ping Service not triggered on my new post using WP-CLI.
apasajja's user avatar
  • 191
0 votes
0 answers
64 views

WP-Cli Error When Mapping Multisite Subdomain

I have a multisite located at example.com which has a subsite located at subsite.example.com. I followed the official Wordpress.org documentation to map subsite.example.com to otherexample.com https:/...
mjones's user avatar
  • 153
0 votes
1 answer
92 views

wp_clear_object_cache() is deprecated. What should I use instead?

Today I noticed that \WP_CLI\Utils\wp_clear_object_cache() has been marked as deprecated in WP-CLI 1.5.0. The release notes don't mention anything about it. What should be used, instead? Do I still ...
rassoh's user avatar
  • 566
2 votes
1 answer
113 views

Setting boolean and array values using wp theme mod set

I need to set a couple of Theme Mods to boolean and array values using WP CLI but can't find any way to do achieve it. I have already tried the following for booleans, but they appear to be treated as ...
Dash Desai's user avatar
1 vote
2 answers
223 views

How to find what pages/posts contain a particular reusable block?

How can I find out what pages and post on a site contain a particular reusable block? Typically, to find content on a site, I issue wp db search *itemlookingfor* (like the post ID, part of a file name,...
Will's user avatar
  • 602
1 vote
1 answer
336 views

When WP_CLI runs Wordpress from the command line, are hooks called?

Yesterday, I found out that a website I worked on as a writer (I have no admin access) had been injecting malicious Javascript code in all its pages, as described in this article by Luke Leal. ...
Rafael Atías's user avatar
0 votes
2 answers
461 views

Update custom plugin with WP-CLI

I made a custom plugin for inserting staging / production versions of a Google Tag Manager container based on the server's IP address. How do I make it compatible with WP-CLI so it will update when I ...
whakawaehere's user avatar
0 votes
1 answer
304 views

Using WP-CLI, how do I delete a post by title or slug, not ID?

The docs show how to delete by ID. How do I delete by slug/title?
John Dee's user avatar
  • 493
1 vote
0 answers
95 views

How can i preserve wordpress database encoding after using wp-cli search-replace with --export flag?

I need to migrate a wordpress database to another server but first i need to change all old url's, stored inside any table, to new ones. To do that, i'm using wp-cli search-replace function with --...
Max's user avatar
  • 121
1 vote
1 answer
1k views

WP CLI not finding plugin commands

On a Ubuntu 20.04 Linode I have a Wordpress installation. I deploy the website using https://github.com/Mixd/wp-deploy, a Capistrano deployment tool. When the website is deployed the folder structure ...
Roberto Cinetto's user avatar
0 votes
1 answer
220 views

WP CLI: search and replace specific directory name of URL

I am trying to use wp cli (with regex) to search and replace. I want to change: domain.com/wp-content/uploads/2020/04/asdnbahsdjhgzw/picture.jpg to domain.com/wp-content/uploads/2020/04/picture.jpg So ...
Elv1s's user avatar
  • 3
1 vote
1 answer
325 views

Get last published post in Wordpress using wp-cli

I'm using below wp-cli command to get latest post ID: wp post list --order='DESC' --orderby='ID' --field='ID' | head -1 This, however is inefficient as all posts are retrieved from DB and then head ...
rok's user avatar
  • 225
1 vote
1 answer
547 views

WP Cli will not execute on Windows

I have tried to install Wordpress CLI on my windows machine running windows 10. But for some reason everytime i try to run the wp Command it says 'sh' is not recognized as an internal or external ...
Jonas Bang's user avatar
0 votes
0 answers
384 views

wp option get blogname --url=my-sub-site.com returning main site option

I have a multisite setup with some 14 woocommerce sites. site_id | domain 1 | local.mainsite.com 2 | local.subsite-2.com 3 | local.subsite-3.com 4 | local.subsite-4.com I want ...
Jurgen Oldenburg's user avatar
0 votes
1 answer
407 views

Working with CLI and missing my namespace classes inside

I'm very new to WordPress development. I hit this error when i developering my own class and namespace to do the life easier to reuse my code on cross of platforms/frameworks. I have added my CLI ...
ParisNakitaKejser's user avatar
0 votes
1 answer
143 views

wp-cli error: "Term is missing a parent"

When I try to export posts via the command line, I get an immediate error that the term is missing a parent: $ wp export Starting export process... Error: Term is missing a parent: name-of-tag (123) ...
Talk Nerdy To Me's user avatar
0 votes
1 answer
55 views

adding wp-cli commands to plugin: how to document to users?

I'm adding wp-cli support to a plugin of mine. Is there an accepted way of letting my users know they can use wp-cli with my plugin? I can put stuff in my readme.tx of course, and I can put an ...
O. Jones's user avatar
  • 471
1 vote
0 answers
54 views

Getting page output HTML without request (for CriticalCSS, PurgeCSS)

I work a lot with legacy website with css files which were shared across many pages which resulted in really bloated stylesheets shipping to browser. I want to do some performance tricks to avoid this ...
jamkaka's user avatar
  • 11
2 votes
0 answers
110 views

Regenerate thumbnails unexpected resolution (96 x 96)

I'm using WP CLI wp media regenerate to resize my thumbnails. I've noticed something a bit weird. The original image I upload is a JPEG with a resolution (DPI) of 72. The images that are generated ...
Sam's user avatar
  • 2,066
2 votes
1 answer
108 views

Does thumbnail regeneration edit the database?

I'm using the WP CLI command wp media regenerate to resize all of the images via the /wp-content/uploads directory. Are the new image dimensions registered in the database in any way or does the ...
Sam's user avatar
  • 2,066
0 votes
1 answer
255 views

WP-CLI media import error

I'm trying to import a JPG to my uploads folder using WP-CLI (macOS). I'm connected to the server, I can update and activate plugins, successfully navigate to all folders, etc. However, when I run: wp ...
itsjustdj's user avatar
1 vote
0 answers
374 views

wp-cli command throws error : "SSL routines:tls_process_server_certificate:certificate verify failed" while querying https website

I use wp-cli with wp restful plugin installed. Running wp cli command wp rest user list --http=https://[url] throws below error: Error: Failed to get url '[url]': stream_socket_client(): SSL operation ...
rok's user avatar
  • 225
0 votes
0 answers
37 views

How to automate creating pages on a hosted wordpress from a local set of folders?

I have a set of folders on my computer (mac) with a txt file and several photos, and I want to make a page out of each folder's content on my hosted wordpress. I think I understand how this is ...
changesquare's user avatar

1
2 3 4 5
8