Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

3
votes
0answers
247 views

Setting Up PHPUnit tests for WP development on Windows

I've been following the instructions in this article to try to set up some testing. I got as far as this instruction bash bin/install-wp-tests.sh wordpress_test root 'mypass' localhost latest before ...
3
votes
0answers
208 views

WP-CLI methods for get_current_blog_id, get_blog_details or $wpdb->prefix

I'm looking for some extra information about an mu site (--url) when attempting to export from a remote server to my local testing environment. One requirement for migration is the existing blog_id ...
2
votes
0answers
92 views

wp core install database connection error

I am new to wordpress but not to programming to please bear with me. I am trying to get a new wordpress project up and running locally using the wp-cli. But when I run the following command: wp core ...
2
votes
0answers
444 views

ACF image field to WordPress featured image

I am working with a CPT that is using ACF fields to manage content and the hero image. With the new Archive page template, I wish to have featured images alongside the content. Earlier we did not ...
2
votes
0answers
243 views

How to reset passwords for all users on a network using wp cli

I have a WP Network (sub directory), Sometime specially in case of security emergencies, it is generally preferred to change passwords for all users. I am looking for a way to reset passwords by ...
1
vote
0answers
31 views

WP-CLI cron on multisite using WP-Toolkit “succeded”, but callback not executed

I'm trying to trigger WordPress crons within a multisite using Plesks WordPress toolkit. Generally it is working, but the callback doesn't seemed to be executed. The command to execute crons: /...
1
vote
0answers
23 views

How to change user admin_color with WP CLI?

I like to know how I can change a users admin color theme with WP CLI.
1
vote
0answers
98 views

How to use wp db export and import together?

When I use WP-CLI I'm having some issues with the wp db export and wp db import commands. I have a local site on my desktop that I would like to migrate to my laptop so I can work on it. So I go on ...
1
vote
0answers
56 views

What could cause WP-CLI search-replace to not replace all instances of a string?

We're migrating a site from dev to production using wp-cli to replace all occurrences in the database for the url, just like in the search-replace example. (http://example.dev to https://example.com) ...
1
vote
0answers
117 views

wp-cli search is returning 'search' is not a registered subcommand of 'db'

I'm trying to search for a string like this: wp db search some-string and get: Error: 'search' is not a registered subcommand of 'db'. See 'wp help db'. wp help db lists 11 subcommands and search is ...
1
vote
0answers
86 views

Shortest script to install a WordPress webapp on Nginx

The following script is the one I use on Ubuntu-Nginx environments, to get a WordPress webapp up and running. I run it with a domain as an argument: bash ~/nwsm.sh example.com My question is what ...
1
vote
0answers
98 views

What tools respect `.distignore`?

You can create a plugin using the wp scaffold plugin PLUGINNAME command. It creates a bunch of files, including .distignore, .editorconfig, .gitignore, .travis.yml. Here is the contents of ....
1
vote
0answers
36 views

Can I check which users ran which updates?

We have a site that was previously updated to 4.8.0. Two of us who normally perform updates did not have the right permissions to run the 4.8.1 update. Using wp-cli wp core update Error: Could not ...
1
vote
0answers
40 views

cURL to install theme

I can't figure for the head of mine how to write a cURL that would install a theme for me once I got a session. Tried binding these headers, but with no success: _wpnonce _wp_http_refferer _themezip ...
1
vote
0answers
39 views

wp-cli fails on installing to subdomain

it's likely I missed something, but I just tried to use wp-cli to install Wordpress on a subdomain. After succesfully downloading, creating wp-config and calling the install procedure with: wp core ...
1
vote
0answers
32 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. ...
1
vote
0answers
303 views

Error when setting up phpunit tests with wp-cli scaffold

I am trying to figure out the setup for unit tests for wordpress plugins. I am using Ubuntu. So far I have: Local WordPress Installation WP-CLI up and running Installed phpunit used wp scaffold ...
1
vote
0answers
100 views

How do I add HTML code to a widget with wp-cli?

I want to add a YouTube video to a widget via wp-cli. The YouTube video is basically an iframe. When I execute the following command: wp-cli widget update text-1 --text='<iframe src="http://...
1
vote
0answers
28 views

For a specific theme, how do I build a list of all the possible theme modification names?

I'd like to use WP-CLI to modify a theme with wp theme mod. But, I do not know what all mods and their associated keys I can set with these commands. I've found that if I change a specific theme ...
1
vote
0answers
239 views

Wildcard for wp-cli search-replace

I'm trying to perform this search replace: wp search-replace 'http://stage.contraindicaciones.net/app/uploads/2015/{08,09}/' 'http://stage.contraindicaciones.net/app/uploads/2016/03/' But curly ...
1
vote
0answers
246 views

Update BackupBuddy with WP-CLI

I've written a script that basically loops through all of the WP sites on our server and updates everything: core, plugins, themes. It does, however run into one issue: It will not update BackupBuddy....
1
vote
0answers
91 views

How can I add an RSS widget using WP-CLI?

I can add an rss widget with this command: wp widget add rss my-sidebar --title=News --items=5 But when I add a URL parameter, like this: wp widget add rss my-sidebar --title=News --items=5 --url=...
0
votes
0answers
22 views

I can not update fields with the tax_input tag using wp cli

i'm using this command for update in command line using wp-cli tool. wp post update 12349 --meta_input='{"opalestate_ppt_parking":"2"}' --tax_input='{array('opalestate_statuschecklist' => 'rent')}'...
0
votes
0answers
12 views

Unit test for wordpress plugin

I have followed wordpress office blog -->https://make.wordpress.org/cli/handbook/plugin-unit-tests/ to implement unit testing in plugin. I have been able to write a simple test on one of my method of ...
0
votes
0answers
17 views

Can run cron event manually with WP-CLI but not with any plugin, unsure if it's being scheduled

I have a cron event that I am able to manually run with wp cron event run --all When I go to my dashboard and go to WP-Crontrol OR Advanced Cron Manager, I can see my event listed and tell it to ...
0
votes
0answers
32 views

wp-cli media regenerate --all results in a 'Killed' message

Was having issues with the 'Regenerate Thumbnails' plug-in as well. Perhaps the same root cause. All plugins, core, etc up to date. On Bitnami Nginx from the AWS marketplace. I DO have some fairly ...
0
votes
0answers
17 views

How to create a gallery using WP CLI?

I am hoping someone has some insight into how to create a gallery using WP CLI. Or at the very least get the IDs for the images imported using "wp media import". I've tried using --porcelain but it ...
0
votes
0answers
26 views

Can't install local plugin (zip) with wp-cli

I'm using WP-CLI with Docker, everything works fine but I can't seem to find a way to install plugins that are on my local drive. I'm following the instructions, and do : wp plugin install ../assets/...
0
votes
0answers
24 views

WP-CLI is unable to update password

I execute following command to change password for admin user from command line: wp user update admin --user_pass="mynewpassword" --allow-root I got following error message: WordPress database ...
0
votes
0answers
17 views

Faster Unit Testing in WordPress?

I'm using WordPress Unit Testing to develop a plugin. The Unit Testing is the one provided by WP-CLI with the wp scaffold plugin-tests command: https://make.wordpress.org/cli/handbook/plugin-unit-...
0
votes
0answers
41 views

WP-CLI with cPanel WHM root, where users do not have shell access

I'd like to run wp-cli for a bunch of WP installs that live in separate cPanel accounts, all under a WHM with root. System is CentOS6. I'd rather not give the user accounts shell access. Wp-cli ...
0
votes
0answers
17 views

Limit a user only to wp-cli only use

I have developed a docker wordpress solution and it uses wp-cli to do the required installation from shell. The installation itself required a user to get generated therefore I create a default admin ...
0
votes
0answers
113 views

How to get WP-CLI to work with bash scripts?

I have wp-cli installed on a WHM/cpanel server running multi-php versions with EasyApache4. I am able to use wp-cli when Im either in the directory where wp-config resides or I use the –path command ...
0
votes
0answers
23 views

Updating category ID using wp cli search-replace

I was wondering if search-replace using the old ID and the desired ID will work on a category and its relations. In order to avoid conflicts, would it be better to limit this at specific tables? I ...
0
votes
0answers
21 views

How come there is no error if I upgrade WordPress core after locking .htaccess permissions to 644?

How come there is no error if I upgrade WordPress core after locking .htaccess' permissions to 644? I upgrade WordPress this way basically: wp plugin update --all wp core update wp language core ...
0
votes
0answers
11 views

WP CLI Update Payment Gateway Settings Doesn't Save

I can enable payment gateways with below command: wp wc payment_gateway update paypal --user=1 --enable=true path=/www #This works well However, when I try to update a setting of the gateway, it ...
0
votes
0answers
65 views

WP-CLI - How to install a plugin from a remote server

I'm trying to install a plugin that i downloaded and i host on my server inside a vagrant box to use locally. I'm running this command to try to install it: wp plugin install https://example.com/...
0
votes
0answers
26 views

Unable to import complete data remote wp-cli wordpress

I wanted to make process of wordpress site migration automate everything works fine but i am unable to import complete site from remote to local.Might be something wrong in code, any help will be ...
0
votes
0answers
59 views

Warning Message is get displayed after executing wp-cli command using linux crontabs

I wanted to update WordPress core version and all plugins every week, so for this I install WP-CLI on my WordPress installed server. So, for doing this I wrote wp-cli command in Linux shell script as ...
0
votes
0answers
35 views

Moving Featured Images

I have been moving around 40k posts from one site to another (different domains), using wp cli, all went well, but it seems the featured image weren't imported. I have now uploaded all media files ...
0
votes
0answers
119 views

How to update subsite's siteurl in WordPress Multisite configuration using WP cli

I can easily update the site url of a subsite by navigating to Network Admin->Sites and change in the particular subsite's siteurl. However, i would like to programmatically change the siteurl using ...
0
votes
0answers
48 views

How to fix “Not enough memory” on Windows 7 and PHP 7.2.0 (cli)

I installed wp-cli tool on windows 7 but when I type wp --help. It noticed error "Out of memory". Pleased help me know WHY and how to fix it?
0
votes
0answers
110 views

wp_remote_request does not return a response from from server when ran as Cron

Problem: wp_remote_get/wp_remote_request of a specific https target fails to return a response unless ran via WP_CLI function. $wp_remote_args => array( 'timeout' => 5, 'sslverify' =>...
0
votes
0answers
34 views

Make WordPress more like Jekyll (using wp-cli package?)

I'd like to create and edit WordPress posts on my local file system and then "push" them to my WordPress blog just as if I'd added them directly from WordPress' web interface. Is there any way to do ...
0
votes
0answers
106 views

WP Cli + xargs fails

I'm trying to regenerate thumbnails using seq but I get signal 9 error. here is my command: $ seq 146280 146300 | xargs wp media regenerate --url='http://www.my-site.com' Found 15 images to ...
0
votes
0answers
69 views

WP CLI - Pass Query / URL Variable to Cron?

Is there a way to pass URL / Query variables when you run: wp cron event run using WP CLI? I have a specific event and ID I want to pass to it but don't know if it is possible or how to pass GET ($...
0
votes
0answers
39 views

Wp-cli from a plugin?

WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, configure multisite installs and much more, without using a web browser. Please note that WP-CLI is ...
0
votes
0answers
32 views

WP CLI update in main and subfolders

I have many sites install in sub folder, the structure look like below: /public_html/ /public_html/site1-directory /public_html/site2-directory How I can run single cli to update core for /...
0
votes
0answers
51 views

Can I use WP-CLI from a remote computer?

Does WP-CLI need to be used and installed on my server which has WordPress installed, and as such, I would need to ssh into that server in order to use it?
0
votes
0answers
69 views

How to prevent WP-CLI shell from exiting when an exception occurs?

I am using WP-CLI shell to quickly debug some code, but every time I run into a fatal exception (e.g. undefined constants/functions) the shell exits and I lose my shell session. Is there a way to ...