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
2answers
37 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 ...
0
votes
0answers
24 views

Trying to install/configure wp-cli for WordPress

I'm trying to install/configure wp-cli for my WordPress website but I keep getting an error everytime I try and run a command. I have a VPS server with Bluehost and I followed a simple installation ...
0
votes
1answer
39 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?
0
votes
0answers
21 views

Using the WP CLI to output the HTML results of calling a post?

I’ve inherited a strange site, where the posts in the backend are built not in the WP editor, but in a series of ACF repeater blocks. I need to format / migrate these posts in a way that they can be ...
0
votes
0answers
26 views

DB option update with wp-cli

I am creating an automation script where I use wp-cli to do plugin/theme installations, configure settings and other. This script is installing the Enfold Parent and Child theme from Kriesi and after ...
1
vote
0answers
17 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 --...
1
vote
1answer
77 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 ...
0
votes
1answer
54 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 ...
1
vote
1answer
52 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 ...
0
votes
0answers
64 views

wp-cli + valet: "Error establishing a database connection"

I'm running Laravel Valet to get a simple WP local development environment. Strangely at some point wp-cli stops being able to do much and gives me a "Error establishing a database connection&...
1
vote
1answer
75 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 ...
0
votes
0answers
63 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 ...
0
votes
1answer
77 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 ...
0
votes
1answer
42 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) ...
0
votes
0answers
23 views

WP CLI custom plugin commands not available on production server

I have WP All Import on one website and I've realized that WP CLI doesn't load the plugin custom commands. It's not related to WP All Import though, because there should be even other plugins commands ...
0
votes
1answer
34 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 ...
1
vote
0answers
30 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 ...
2
votes
0answers
83 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 ...
2
votes
1answer
45 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
50 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 ...
1
vote
0answers
143 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
33 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
20 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 ...
2
votes
1answer
128 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
59 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
101 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
501 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
217 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
68 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
104 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>...
1
vote
1answer
192 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
24 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
18 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
261 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
127 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
16 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
151 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
552 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
57 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
31 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 ...
4
votes
2answers
98 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
1answer
62 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 ...
2
votes
1answer
116 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
144 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
1answer
16 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
250 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
169 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/&...
3
votes
1answer
158 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
37 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
117 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' => '****',...

1
2 3 4 5
7