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
0answers
14 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 ...
1
vote
0answers
52 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 ...
1
vote
1answer
15 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 ...
0
votes
1answer
23 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 ...
0
votes
0answers
54 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 ...
0
votes
0answers
24 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 ...
0
votes
0answers
16 views

WPCLI spits out huge amounts of unneccessary information

When I run some common 'wp' commmands, I typically get huge amounts of information that seems unlrelated to my intent. For example, if I do 'wp plugin list' I get a screenflood, a segment of which ...
1
vote
0answers
42 views

Get WP CLI to hide debug warnings and notices in JSON output, same setting as website

Summary: WP CLI can be used to get a JSON output of all the plugins installed on a site, but the output gets corrupted due to warnings although log levels are set to low. Problem Unfortunately, I have ...
0
votes
0answers
21 views

WooCommerce : Problem regenerating image thumbnails after uploading manually

I am working on a script (in VBScript) that synchronizes a shop managing software's database (called EBP) with WooCommerce's database, and I haven't had any issues so far. Only when I try to upload ...
1
vote
2answers
42 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
0answers
334 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: ...
0
votes
0answers
144 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
46 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
64 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
52 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 ...
0
votes
0answers
16 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 ...
0
votes
0answers
17 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
79 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
68 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
54 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
344 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
35 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 ...
0
votes
0answers
26 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
40 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
23 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
1answer
39 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
0answers
33 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 ...
2
votes
1answer
49 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
84 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
102 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
20 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
248 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
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
165 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 ...
0
votes
1answer
98 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
0answers
67 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 ...
3
votes
1answer
105 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
23 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
0answers
87 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
10 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 ...
1
vote
1answer
52 views

Skip WooCommerce 4.5.x onboarding with WP-CLI [closed]

I have a bash (.sh) script that I use to install WordPress and install/activate various plugins through WP-CLI commands. Now I want to extend that by installing/activating WooCommerce and setting ...
0
votes
1answer
40 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 ...
0
votes
1answer
266 views

How do I trigger WP CLI DB export using a PHP function?

I want to use WP-CLI to export a database - using wp db export - to create backups. I also need to use cron to control the backup schedule. WP-CLI is installed on my managed host, and I can use it via ...
0
votes
1answer
1k views

Migrating Multisite with WP-Cli and/or Search-Replace-DB

I have a Wordpress 5.5 / PHP7.3 MultiSite production site installation that I am trying to migrate to my local LAMP dev environment so that I can edit. The Problem: is that when I run Search-Replace-...
6
votes
2answers
564 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
1answer
32 views

Remove files unrelated to WordPress from uploads

Is there a wp-cli command or any easy way to remove files that are unrelated to WordPress, but FTPed or synced to the uploads directory accidentally?
1
vote
0answers
282 views

How to use WP-CLI / WC-CLI to bulk import 1000s of products (variable and simple)?

I am a junior developer and I have been asked to work on a wordpress site that has previously been using All Import plugin to upload products. The problem is, this is not functioning properly, and is ...
0
votes
0answers
95 views

wp cli search and replace on --network Error reconnecting to the database

I'm getting a new Vagrant VM WordPress setup. I've downloaded my production db and I normally I go through and use a search and replace to find a production url and change that to a local development ...
2
votes
0answers
82 views

WP WPQuery, not running properly in WP CLI

I'm running a simple query just to find simple WooCommerce products, here is the query which works fine in the header of the site: $args = array( 'post_type' => 'product', 'posts_per_page' =...

1
2 3 4 5
7