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
1
vote
2answers
27 views

Formatting messed up when piping wp commands

Ok, so I have been using wp plugin update --all in the past with a tee command. There has been no problem in the past, but after I ran an update on my system, everytime I run the command through a ...
1
vote
2answers
252 views

Unable to install plugins from wp-cli

Hi I am using a Ubuntu system. I am using a shell script to download wordpress from wget, update config and run it from nginx server. Now I want to update this shell script so that when we install a ...
0
votes
2answers
571 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
1answer
33 views

Mocking WP_CLI static methods in unit tests

I'm writing unit tests (not integration) for a lib I'm working on. There, we created some WP-CLI commands that I'd like to test. Most of them are just renaming things, copying and pasting things over ...
0
votes
1answer
584 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
95 views

wp search-replace on database returns PHP fatal error: Array and string offset access syntax with curly braces is no longer supported

So I need to setup a client website locally for improvements. I'm trying to search and replace any instances of the live site's name/url and replace it with a development one. When I run the command: ...
1
vote
1answer
2k views

WP-CLI command to update all plugins and core fails when executed from cron

I have the following WP-CLI command to update all plugins and core. It seems to fail when being executed from cron (other cron commands work): 0 0 * * 0 for dir in /var/www/html/*/; do cd "$dir" &...
6
votes
2answers
375 views

Enable Auto-updates for all plugins using wp-cli? (since wordpress 5.5)

Since WP 5.5 just released and now you can set plugins to auto-update, can this be done via wp-cli? Looking at the documentation, I don't see a sub-command for it: https://developer.wordpress.org/cli/...
0
votes
0answers
57 views

call to undefined function mysql_connect

Trying to run a search and replace but am getting an error Call to undefined function mysql_connect() in E:\xampp\htdocs\test\wp-includes\wp-db.php:1688 I have checked my WP files and have both ...
1
vote
1answer
89 views

Error: reassigning content to a different user is not supported on multisite

Objective:There's a need to remove a user from the multisite. Before doing so, user's content needs to be "transferred to another user" in a subdomain setting/specific site that's not the parent. ...
8
votes
4answers
8k views

wp-cli displays php notices when display errors off

I am using wp-cli and I am having php notices and errors show up when running wp-export. Some of these warnings and errors are ending up in the output file. How can I force errors to NOT show up. I ...
1
vote
1answer
33 views

WP CLI Get all Enqueued Scripts and Styles

Normally, I would hook into the wp_enqueue_scripts action in order to gather a list of enqueue'd scripts and styles. However, I have a very intensive process I need to run, thus instead of running it ...
2
votes
0answers
33 views

How to get all posts related to a term with WP-CLI?

I want to get all french brands. When I try with post type brand, it works (for example it returns 1000 results). wp post list --post_type=brand If I add a parameter: taxonomy term (--<taxonomy>...
0
votes
1answer
24 views

How do you kill WP-CLI execution?

I am experimenting with WP-CLI on Windows 10 and XAMPP. I probably don't understand how it works, because I expected stopping Apache from the XAMPP Control Panel would stop WP-CLI script execution on ...
1
vote
1answer
122 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 ...
0
votes
0answers
11 views

Best practice for converting legacy structure of blogs.dir to modern site/files path for uploads in site network

On more than one occasion recently I have needed to convert quite large legacy WP Site Network sites using blogs.dir to the current structure using sitename/files, and I am looking for a standard and ...
1
vote
2answers
801 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
0answers
10 views

WP CLI Run WP_CLI\Utils\format_items before script finished

How can I run WP_CLI\Utils\format_items before the command has finished? Currently the output will only get returned once the command has finished, kinda like WP_CLI::success('This message will first ...
0
votes
1answer
15 views

Logs for WP CLI

I am running a WP CLI script to regenerate images, seq 192000 194000 | xargs wp media regenerate —only-missing and i got errors, example: Warning: Can’t find “margot-fox-pope-francis-post” (ID 204823)....
1
vote
0answers
34 views

How can I search and replace by post type?

I am trying to use WP-CLI to do a search and replace on about 10,000 posts that were imported from another CMS and it has a great deal of old inline styles and spans and such. I would like to be able ...
0
votes
0answers
12 views

Media Library Cleanup A Thought Exercise

I have a site with roughly 1200 posts. Each post has a featured image and a few placed images in the content. Over the years we have had a bad habit of using the WordPress image editor to crop and ...
1
vote
1answer
25 views

WP CLI not outputting anything

I am trying to use wp cli command line tool, but like many others it doesn't work for me. The site itself is loading with no issues. getting info does work: $ wp cli info OS: Linux 5.4.0-54-...
1
vote
1answer
157 views

Can't generate pot file using wp cli

I'm developing a child theme and I want to get .pot file using wp-cli. I follow the wp-cli handbook and run: cd /media/sf_TOOLS/ubuntu-20.04/bin curl -O https://raw.githubusercontent.com/wp-cli/builds/...
0
votes
0answers
23 views

Theme Customization with WP CLI

It seems we cannot say Hi here, However, I search on the documentation, and the github, however i don't find any information about customization of theme through WP CLI. Is it possible to do the same ...
6
votes
2answers
2k views

wp-cli commands do nothing, return nothing

I'm using wp-cli 1.5.1. My server is running php7.2. I'm not running suhosin. (Some people seem to think that suhosin may cause the same symptom) When I issue wpcli commands within a non-wordpress ...
4
votes
3answers
158 views

Disable comment windows for all existing posts (pages/blogposts)

Is there a WP-CLI command to disable comment windows for all existing posts (pages/blogposts)? I ask this since when I change a theme for a site I have, all pages in that site getting their comment ...
0
votes
0answers
25 views

WP-Cli Autoloads Non-existant Framework

When I run wp version --debug it shows that the bootstrap framework is being autoloaded and missing files... when in reality after tested bootstrap and decided not to use it... I completely removed it ...
0
votes
0answers
28 views

Prompt user for input in WP CLI

I am missing some feature to prompt the user for input. In Laravel we have $this->ask('What is your age') (https://laravel.com/docs/8.x/artisan#prompting-for-input) I haven't been able to find any ...
0
votes
0answers
16 views

set filename as image title in the media gallery of Wordpress

How to set filename as image title in the media gallery of Wordpress, using wp-cli ? In other words, I'd like my image titles, stored in wp-content/uploads to be exactly their image filenames (without ...
0
votes
0answers
24 views

How do I connect to a MySQL container from my PHP container so I can run my wp-cli command?

I am using wp-cli and trying to run the wp command wp config create --dbname=wp_database --dbuser=wordpress-user --dbpass=password-example --locale=en_GB I use a similar Docker environment for Laravel ...
3
votes
3answers
4k 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 ...
3
votes
1answer
3k views

PHP warning are displaying when using WP CLI [closed]

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
1answer
38 views

How can I list only sites that use a particular theme or plugin?

I need to search through dozens of WordPress multisite (network enabled) installs for sites that use a particular plugin. How can I list only sites that use a particular theme or plugin, preferably ...
0
votes
1answer
52 views

WP-CLI plugin install causes PHP fatal error - Using $this when not in object context

When running sudo wp install plugin pluginname --allowroot It causes an error: PHP Fatal error: Uncaught Error: Using $this when not in object context in /var/www/html/wp-content/plugins/pluginname/...
0
votes
0answers
79 views

Can't activate a theme with wp-cli/wp-env … and other questions

I seem to be able to activate my theme from the wp-env/wp-cli cli. No problems there. Problem is though, although the command is a success. The theme doesn't actually activate on localhost even after ...
0
votes
0answers
17 views

Pulling in a private gitlab repo for wp-env docker instance …

I’m trying to import a repo for wordpress wp-env docker instant container. Is it possible to pull in a private gitlab repo through wp-env.json ? According to the docs you can import a public repo from ...
0
votes
0answers
174 views

Using wp-cli to run WP All Import

So my client has multiple imports running over cron using WP All Import and for one import you need to trigger it and then process. Now as it should be much faster over WP-CLI I set it up, I can see ...
0
votes
1answer
60 views

WP-CLI Error Requesting CURL Extension

Instantly fell in love with WP-Cli... life at real speed, ditch the GUI.. :-) Each time that I run a command, it executes successfully, however I get the following error message and warning: <br/&...
0
votes
1answer
13 views

Give WP-Cli User Home Directory Privileges

I am on an Ubuntu 18.04 local dev environment, running a WP Multisite 5.5.3 Three Part Question: 1.) What (who) is the WP-Cli user? And, 2.) How do I give that user permission to "my_user's&...
1
vote
0answers
110 views

Only the WP CLI command, wp --info, runs under my cPanel account

Please review the following commands I have issued remotely to the Bash Shell on my dedicated cPanel/WHM server: [root@host ~]# wp cli update Success: WP-CLI is at the latest version. Then I ...
1
vote
1answer
133 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 ...
7
votes
2answers
4k views

How can I batch delete all unattached images with WP-CLI or other automated process?

After using WPML Media, a plugin that creates duplicates of each image for each language, we now have almost 100,000 duplicate images that we're not going to use and need to get rid of. We need to ...
0
votes
0answers
48 views

How to execute filter with WP Cli?

I use a plugin called WP All Import and I would like to use it with WP Cli The cmd is : wp all-import run X But I realised that the filters I used with the php importation, doesn't fire.. How to ...
2
votes
1answer
65 views

How can I use WP-CLI commands without --allow-root

I wanted to use WP-CLI commands in my putty WordPress 5.5.1 & Ubuntu 20.04 Droplet but “When I use Wp commands without –allow-root then It shows an error that you are accessing as the root user,” ...
0
votes
1answer
18 views

Circumvent WP CLI Command

I am writing a maintenance mode plugin for my multisite setup. At its core its a very simple script that returns a maintenance mode page when a option is set. Now, I want to add cli commands to enable ...
0
votes
1answer
61 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
0answers
57 views

How to add an array to a command “wp config set”?

you need to add a constant when building a docker file wp-config.php define( 'AS3CF_SETTINGS', serialize( array( 'provider' => 'aws', 'access-key-id' => '*****', 'secret-access-key' => '****',...
0
votes
0answers
9 views

Thumbnails not displaying on web page

I have been struggling with correcting this error for a while now, I have no idea as to what is causing it. The posts thumbnails are not displaying on the page, however the pictures in the posts are ...
2
votes
2answers
2k views

“Could not open input file” error even when WP-CLI is in the path

I'm developing Wordpress locally with XAMPP, and currently trying to install the WP-CLI tools as described here using Cygwin. I renamed wp-cli.phar to wp, made it executable and moved it to the ...
0
votes
1answer
31 views

How best to keep my localhost on Http while my Remote production is on Https

I am using a plugin **Really Simple SSL** that configured to use SSL. And I use WP Migrate Pro to move my DB from local to remote. But I usually run into the problem of pulling the DB from productions ...

1
2 3 4 5
7