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.
390 questions
3 votes
0 answers
51 views
WP-CLI: How do I set boolean flags as default in my local wp-cli.yml config file?
I have a wp-cli.local.yml file and I'd like to make sure the --all flag is set by default when I run the wp plugin update command. I'd also like the option to set the --skip-themes and --skip-plugins ...
0 votes
1 answer
88 views
wp-env Could not open input file: /tmp/composer-setup.php
When running wp-env start I get the following error and wp-env crashes: > [cli 12/14] RUN php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer: #43 0.447 Could not open ...
0 votes
0 answers
98 views
Will WP-CLI "wp media regenerate" delete the changed thumbnail sizes by default?
I have have a site with 180,000 images. Most were added via SFTP and then added to the Media Library with the Add from Server plugin (which creates the image post and generates the WP and theme ...
0 votes
1 answer
82 views
How to invalidate wordpress_logged_in cookie via backchannel logout
We run WordPress with the OpenID Connect Generic Client plug-in to provide SSO using Keycloak. Currently, we are looking for a way to log users out of WordPress without having them visit WordPress in ...
2 votes
0 answers
302 views
How to use wp-cli's post list function to return posts published in a specific date range?
I'm trying to use wp-cli's wp post list function to select posts from a specific date range but I cannot figure out the proper syntax to use. According to its documentation, you can use the syntax ...
1 vote
2 answers
137 views
Why is version showing as "42" instead of "6.6.1" in dashboard
Why do you think this is happening? I just updated a bunch of client sites and they all show me running 6.6.1, but this particular site says simply "42" for the version. I've reinstalled the ...
0 votes
1 answer
219 views
Bulk delete 'Global Attributes' in WooCommerce via WP-CLI?
Is it possible to delete the global product attributes in WooCommerce by using WP-CLI? I've often cleared out Users, Orders, and other items using something like this... wp post delete $(wp post list -...
0 votes
1 answer
212 views
Cannot register a custom WP-CLI command
I am working on a custom plugin and one of it's functionailities is to scan all the posts/pages on daily basis and update a meta-data in the database. I also wanted to create a custom WP-CLI command ...
0 votes
1 answer
103 views
Export Wordpress theme with modifications for other site
I purchased wordpress theme. No i have upoloaded it on new site and modified it as i wanted. Now i want to use that theme in my all sites. Problme is theme also saves its oevrride stuff or ...
0 votes
0 answers
134 views
Why WP CLI command is not visible in VIP CLI
I have registered the command like below and pushed this to VIP's development environment but when I try to execute this command from VIP CLI it throws an error. Note: on local this command is being ...
1 vote
1 answer
525 views
Which WP-CLI commands can be safely run with --allow-root flag?
Over the past several years, WP-CLI has become pretty popular, but there's still a lot of warnings about the --allow-root flag for security reasons, and instead developers are urged to use non-root ...
1 vote
0 answers
47 views
How to revert the media structure from /uploads/year/month to the /uploads directory in wordpress?
I tried to use wp-cli using regex like this: wp search-replace 'uploads/[0-9]+/[0-9]+/' 'uploads/' --all-tables --regex but in this case there is a problem with possibly repeated file names and ...
0 votes
1 answer
120 views
Changing boolean value with "wp option patch"
I am trying to change a boolean value (in a serialized object) via wp option patch. But it doesn't work. If I use true (without quotes), it changes to string, if I use 1, it changes to int. Is there a ...
2 votes
2 answers
2k views
What are the proper permissions for production use of wp cli
I am running several instances of WP on GCP VMs and a test VM setup with Ubuntu 22.04 / PHP8.1 and followed the instructions at https://make.wordpress.org/cli/handbook/ to install wp cli. The wp info ...
0 votes
1 answer
393 views
Cannot Flush Permalinks with WP-CLI
I am using wp-cli to create a WordPress website. I am running LAMP server. I am able to change the permalinks from ugly to pretty with the following commands: wp rewrite structure '/%postname%' wp ...