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
16 views

WP CLI: there has been critical error

I am using Wordpress 5.3 minimal installation and currently have not installed any other plugins. I have installed WP CLI and below is the output of wp-info: OS: Linux 5.0.0-1025-gcp #26~18.04.1-...
0
votes
0answers
8 views

wp cli import media adding 10 files for each media files on disk. is it a bug?

I copied some files to my server; Then I ran: wp media import *.jpg Then in wordpress > media-library, there are 10 different sizes for each file, EACH size has its own entry in the media library. ...
1
vote
0answers
24 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 ...
3
votes
1answer
48 views

How can I run a WP-CLI command as authenticated user?

I've written a command for wp-cli called wp nurse. It is styled after the wp doctor command, except is meant to run the WordPress Site Health checks. Using the in-browser tool, all 16 tests currently ...
2
votes
1answer
25 views

Ask WP-CLI latest core WordPress version released

I'm trying to make a script (bash) that examines all WordPress installations on my server and returns a set of information. I would need to know the latest known version of WordPress (official ...
1
vote
1answer
23 views

Where do the files of a custom WP CLI Command reside?

I want to create a custom WP CLI command and I have read the documentation but I just don't understand for the life of me how this works. Do I need to declare it before in my config file where they ...
0
votes
0answers
24 views

WP-CLI works for all installations but one

I have the latest wp-cli installed on Windows 10 Pro. Running WP locally on laragon. For all installs, I've got it to work nicely, but at one of them, any wp-cli command except wp --info doesn't do ...
3
votes
1answer
53 views

Does wp post delete also delete metadata associated with posts?

say this: wp post delete --force $(wp post list --post_type=product --format=ids) I found out that it's far more fast and performant than deleting posts from admin. But I was wandering: any ...
0
votes
0answers
24 views

WP-CLI regex - search-replace match specific tags and any characters in between

I am using WP-CLI regex to replace specific tags and the content within the tags. Note that the content between the tags is dynamic so can change. I want to replace everything between [vc_row ...
1
vote
1answer
24 views

Remove all users from site except one using WP CLI

I would like to remove all users from WordPress site using WP CLI except one (me, as administrator). This command remove every user: wp user delete $(wp user list --field=ID --number=10) ...
1
vote
0answers
51 views

How to delete 1000s of duplicated images in Wordpress?

We kinda have a wired problem that took me weeks of searching and testing, the problem is that while working on one of my client's Wordpress website I noticed that there are around 75k images in ...
0
votes
0answers
32 views

wp-cli wp media regenerate --only missing deletes unused sizes?

I just ran wp media regenerate throught 200k images... thing is I have 400k, and the range command is not working (200000 400000 | xargs ***) If I use wp media regenerate --only missing will it ...
4
votes
1answer
71 views

Difference between deactivating, uninstalling, and deleting plugins

I understand the difference between deactivation and uninstallation. But the CLI also has a delete option. How does it differ? To be safe, should I deactivate, then uninstall, then delete?
0
votes
0answers
15 views

WP-CLI command to rename menu?

Do you know a wp-cli way to rename menus? I don't see any reference to that in the documentation. Tried wp menu: usage: wp menu create <menu-name> [--porcelain] or: wp menu delete <menu&...
0
votes
0answers
11 views

Synchronize multisite: diff of activated plugins and settings

I have a multisite setup with an increasing number of languages and it’s a bit of a plugin mess. Consequently I’m about to start building something around wp-cli that can help me with this by first of ...
0
votes
1answer
23 views

WP-CLI plugin activate - 'activate' is not a registered subcommand of 'plugin'

I just downloaded the latest version of WP-CLI bundle to my Mac and now this WP-CLI plugin activate XXXXX doesn't work. It gives me the message wp plugin activate XXXXXXX 'activate' is not a ...
1
vote
0answers
24 views

Update a post based on results from GET request to another server

I need to use GET requests to retrieve the current status of a device and then update the body of a specific Wordpress post with the text data sent by the external device (for reference, it will use ...
0
votes
0answers
47 views

wp-cli core install --skip-email and --skip-config flags not working on MAMP unknown parameter

This command wp core multisite-install --url="dev3.XXXXXXX.wp" --title="XXXX" --admin_user="XXXXXadmin" --admin_password="XXXXX123" --admin_email="XXXX@XXXX.com" --skip-email --skip-config Creates ...
0
votes
1answer
44 views

wp-cli core install unknown: fatal: file /etc/postfix/main.cf: parameter mail_owner: user postfix has same user ID as _postfix

I'm trying to setup two wordpress virtual hosts on my macbook using a shell script composer and wp-cli. The first virtual host has been working perfectly. When I run the script for the 2nd virtual ...
4
votes
1answer
154 views

WP CLI info showing correct PHP binary but wrong version of PHP

When a run a command such as wp plugin update I get the message: "Your server is running PHP version 5.4.13 but WordPress 5.2.2 requires at least 5.6.20" I don't even have PHP 5.4 installed in my ...
2
votes
1answer
65 views

WP-CLI update date and time format

I'm new to WP-CLI. After a lot of Googling and searching in this forum, I haven't found out which is the command to update both date and time formats. wp option update...... Thanks for any help! ...
2
votes
1answer
50 views

Is there a way to pre-cache plugins with WP-CLI for faster installation?

So I can cache a WordPress installation with: wp core download --version=4.5 --path=/tmp/wp45 Subsequent requests of version 4.5 will be pulled from wp-cli local cache. I think that: wp plugin ...
1
vote
0answers
28 views

WP-CLI search-replace posts content for certain URLs

Using WP-CLI I am wanting to search and replace posts content but only for certain URLs. This is what I have so far: $ wp search-replace 'Contact us today' 'Contact us today by filling in the form ...
0
votes
1answer
61 views

Create Wordpress Multisite Instance Programmatically

Our CI process sets up everything from scratch, including WordPress, and our WordPress is a multisite instance. Adding a site after the Multisite functionality has been setup is easy to do ...
0
votes
1answer
27 views

How do I deactivate widgets by name?

I cna get list of widgets with wp widget list sidebar-1 | search | search-2 | 1 | {"title":""} | recent-posts | recent-posts-2 | 2 | {"title":"","number":5} | recent-comments ...
1
vote
1answer
25 views

How do I update a nested option?

I use this command to get values of ez-toc-settings->auto_insert_post_types wp eval "print_r(get_option('ez-toc-settings')['auto_insert_post_types']);" and this prints out the correct values: ...
1
vote
1answer
23 views

wpcli: Error on post_content or post_title if accents

When I try to create a new post with accents width wp-cli (in windows 10 command, I got latest wp-cli) wp post create --post_title="Héllo" --post_type=page --post_content="Héllo world" I got error: ...
1
vote
1answer
20 views

How to retrieve text only from a post using WP CLI?

I have the post ids and urls. I need to extract the post content make some modifications and update again. I have more than 2,000 posts hence I would like to do it using WP CLI and not manually. Can I ...
0
votes
0answers
13 views

“New_Version” in Plugin Update is blank

When updating WP-MAILTO-LINKS, the new version is always blank. So, in my environment the update is done every night, because WP-CLI thinks, that my installaed verison is old... :(
1
vote
1answer
84 views

How to change a post attribute to homepage using WP CLI?

I want to convert a page to homepage. To add widget to homepage I need to do that. How will I be able to do that using WP CLI?
0
votes
1answer
58 views

wp-cli PHP Notice after moving server behind load balancer

After setting up an Amazon Elastic Load Balancer, where SSL terminates, I was getting Mixed Content errors on the site, until I added the following line to wp-config.php. if (strpos($_SERVER['...
2
votes
1answer
45 views

How to run nested xargs commands?

I am trying to loop through all sites on a multisite network, and for each site, delete all subscriber users. I have tried this WP-CLI command: wp site list --field=url | xargs -n 1 -I ^ wp user ...
0
votes
1answer
36 views

How to delete a single post using wp cli in command line?

I want delete a single post using wp cli in the command line. There was some issue on one article, where my hosting disabled networking & now want me to remove the article using the console. I ...
2
votes
2answers
509 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 ...
1
vote
1answer
345 views

“Class 'Phar' not found” error setting up WP-CLI with Cygwin

I'm trying to install the WP-CLI tools as described here using Cygwin, which the guide claims is supported. When doing: cd /XAMPP/htdocs curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-...
1
vote
1answer
614 views

WP-CLI over SSH - wp command not found

I'm stuck trying to do the remote SSH with WP-CLI. I have installed WP-CLI on my Webfaction server and tested it's working # This is in server $ wp --info OS: Linux web561.webfaction.com 3.10....
0
votes
1answer
50 views

How to specify which editor is used when editing posts with WP-CLI?

On macOS, when I do wp @alias post edit 1 I get nano. The same happens when I do EDITOR=emacs wp @alias post edit 1. I want emacs, My EDITOR is set to emacs. How do I get emacs? Note that env|grep ...
0
votes
0answers
22 views

Write WP-CLI core check command to file with table structure

If I run the following in console: wp plugin list --update=available I get: +--------+--------+-----------+---------+ | name | status | update | version | +--------+--------+-----------+-------...
1
vote
1answer
25 views

wp-cli configuration in php?

https://make.wordpress.org/cli/handbook/config/#config-files is pretty good, but I'd like to have some more logic in my configuration. Is there a standard way for this? For drush I have .drush/...
1
vote
0answers
45 views

WP-CLI can't list posts

I have a WordPress Multisite (behind a firewall). I use WP-CLI for lots of things. But for some reason wp post list does not work. wp post get works. But wp post list always yields the same output, ...
2
votes
2answers
89 views

wp-cli silently fails with 255 when running wp core install

Working within a Docker container (circleci/php:latest) and I'm struggling with wp-cli a bit. When I attempt to run wp core install I get a silent failure with 255 exit code. I enabled --debug hoping ...
0
votes
2answers
30 views

Is it possible to view WP documentation within the WordPress shell?

I'm having trouble navigating the WP documentation so forgive me if this is common knowledge. Is it possible to view the documentation of classes and methods from within the shell? That is, is there ...
0
votes
0answers
102 views

bash script wp-cli search-replace 0 replacements, but command-line 3000+

I'm runnning this command; sudo -u www-data wp search-replace www.siteurl.com www.newsiteurl.com --recurse-objects --skip-columns=guid --skip-tables=wp_users From command line: 3.456 replacements ...
3
votes
1answer
165 views

wp-cli create post and media import

I would like to create a post and insert a url as an image, right now I have this, it works but creates a gallery block, instead I would just like to create a simple image block . What is the correct ...
0
votes
3answers
90 views

WP changes siteurl, but some URLs then don't work

I have a WP installation that needs moving to a new site URL. I have tried the usual methods listed on this codex. All of them produce the same problem. When I hit a link like this on the site: <...
1
vote
2answers
328 views

wp search-replace (not executing)

I'm running multisite. Looking to replace old URLs with new URLs for pulling a copy of the site form one environment to another environment. Here is my command: wp search-replace --url=domain.com ...
1
vote
1answer
133 views

Does WP-CLI support updating multiple options via a single command?

I'm looking for a way to update multiple options via a single update command. The documentation only suggests the following usage: wp option update <key> <new_value> Does WP-CLI accept ...
3
votes
1answer
88 views

Need MySQL Query or WP-CLI command to updates old URLs in Shortcodes [closed]

My client's website is moved from http to https, and I have updated most of the URLs using queries in phpMyAdmin, but I have been unable to update shortcode URLs. I have used the following query to ...
3
votes
1answer
269 views

WP-CLI Process Killed

I have around 1200 large images which I'd like to regenerate. I'm using the WP-CLI command wp media regenerate. After around 61 images are generated, the terminal shows the message Killed. Why is ...
1
vote
2answers
57 views

Removing a wordpress multisite installation and preserving the database before migrate to nginx

I have a WordPress multisite installation, and I need to remove the multisite, and keeps just the site ID 5 (domain.com/br) in the main address (domain.com). So I follow this tutorial to remove ...